Change hostname on XenServer

Logon to the console of the XenServer host. Check host uuid:
# xe host-list

Change the name:
# xe host-set-hostname-live host-uuid=<HOSTUUID> host-name=<NEWHOSTNAME>

Example
# xe host-set-hostname-live host-uuid=00cbeec7-c229-4ab9-990f-cdb5f781da11 host-name=xen-002

Reboot the host:
# reboot

Move a Hyper-V VM to XEN Server 6.2

Because XenConvert does not work on version XenServer 6.2, I need to find another way to import virtual machines running in Hyper-V (Windows 2008 R2) to XEN Server 6.2.

Xen Server support recomended this how ever it did not work in my environment:
– Create a NFS share on a Windows server.
– Add a new SR in XEN. NFS VHD and using the NFS share on the Windows server.
– Copy the VHD file from Hyper-V into the NFS share.
– Rename the VHD file to <uuid>.vhd. Use uuidgen to get a valid uuid.
– Rescan the storageĀ  and you will see a new untitled virtual disk in the storage panel in XenCenter.
– Create a new VM but do not start it.
– Delete the disk associated to that VM.
– Attach theĀ virtual disk you copied before from Hyper-V.
– Boot the VM and install XenTools.

This did not work, I didn’t see any new untitled virtual disks after rescaning the storage.

My solution:
Start XenCenter. File/Import.

Import source. Brows to the VHD file you want to import.
VM Definition. Add a name to the VM. In this example: SRV001. Add CPU’s and memory for this VM.

Location. Choose if you want the VM to have a home server.

Storage. Choose where you want to place the virtual disk.

Network. Choose network configuration for the VM.

OS Fixup Settings. Enable ‘Use Operating System Fixup’.

Transfer VM Settings. Here you must use the correct Network and IP (must be on the same IP network as the OS Fixup ISO SR.

If your Hyper-V VM consists of more then one VHD file you need to do this task for each VHD file. When import is done detach the disks from the other VM’s that a created under the imports. Attach those disks to the first created VM containing the VHD file for Windows C: drive for example. When this is done you can delete the VM’s from the import (they have now no assigned disks).

Start the VM. Install XenServer Tools. Remember that the Hyper-V integration is in embedded in Windows 2008 R2 and above and can not there for not be uninstalled from the VM.

Add additional local disk on XEN Server

My version of XEN Server: 5.6.0. Install the new disk. I my case, added the new disks and used HP ACU to creat the array and the logical disk.

Logon to the XEN server as root via SSH (or you can access the local command shell from the server console).
# fdisk -l

This will display the installed disk. Find the new disk. It should be the last on the list. I my case it was /dev/cciss/c0d2. The first disk was /dev/cciss/c0d0 and the second was /dev/cciss/c0d1 and the new /dev/cciss/c0d2.

# xe sr-create name-label=<Name of Storage> shared=false device-config:device=<Path of the Storage device> type=lvm
– Name of Storage is the name of the Storage Repository.
– Path of the Storage device is the path you found out when you displayed the installed disks.

In my case:
# xe sr-create name-label=NewLocalStorage shared=false device-config:device=/dev/cciss/c0d2 type=lvm

Install HP SIM/SNMP Agent on Citrix XenServer 6

1. Go to hp.com and support & drivers. Search for your hardwares drivers, for example HP ProLiant DL380 G7. When selecting operating system select Citrix XenServer 6.x. Dowload “HP SNMP Agents for Citrix XenServer “. The file that you download is named hp-agents-xs.iso.

2. Upload hp-agents-xs.iso to your XenServer host. For example via FileZilla:
Address: XenServers IP-address och hostname.
Username: root
Password: <root password>
Port: 22

Create a folder named iso in /. Upload hp-agents-xs.iso to the iso folder.

3. Mount the iso image on the XenServer host.
# mkdir -p /mnt/iso
# mount -o loop /iso/hp-agents-xs.iso /mnt/iso

4. Install the HP SNMP Agent n the XenServer host.
# cd /mnt/iso
# ./install.sh

5. Unmount the iso image on the XenServer host.
# cd /
# umount /mnt/iso

6. Delete the iso image.
# rm -rf /iso

7. Delelte the iso mount point.
# rm -rf /mnt/iso

8. Logon to HP SIM and discover the IP-address or hostname of the XenServer host.

Creating SR. No such device

When adding new storage repository on XenServer 5.5 you get the following error:
Creating SR
No such device

Solutions
Restart all the XenServer host and add the new storage repository again.

Remove XEN host from pool

1. Find the UUID for the host you want to remove.
# xe host-list

2. Remove the host. Use the UUID from step 1, in this example the UUID is xxxx-xxxx-xxxx-xxxx-xxxx
# xe host-forget uuid=xxxx-xxxx-xxxx-xxxx-xxxx