user.p0d.org

bits release in progress

XCP or XenServer

At work we moved from xm (xend) to xe (XCP or XenServer), and i struggled to find useful informations on it (see the resources at the bottom of the page).

Here are some scripts i made to help me with the maintenance in the command line interface.

Theses are all tested with Xen Cloud Platform 1.6; might work with other versions.

Tools

VDI mount (and ummount)

You can download my vdi-mount and vdi-umount scripts; their usage is straighforward:

  • vdi-mount < vm-uuid | vdi-uuid | vm-name > attempt to mount the VDI in the DOM0
  • access your VDI filesystem (by default in /mnt/tmp); you possibly will have to mount the other partitions if your VDI is partitionned
  • vdi-umount < vdi-uuid-as-returned-by-vdi-mount >
CLI helpers

Put xcp.sh somewhere and source it; the following commands will be made available:

xcp_vdi_by_mountpoint:
Print a VDI UUID by it's mountpoint.
xcp_vm_uuid:
Take a VM name or VM UUID and print a VM UUID.
xcp_vbd_by_vdi:
Print a VBD UUID by it's VDI.
xcp_device_by_vbd:
Print a device by it's VBD UUID.
xcp_vnc_port:
Print a VNC port of a VM.
xcp_vdi_by_vm:
Print the VDI UUID(s) of a VM.
xcp_vm_by_vdi:
Print the VM UUID of a VDI.

Errors and solutions

message Unix.Unix_error(63, "connect", "")
xe-toolstack-restart
Error Connection refused (calling connect )
xe-toolstack-restart
Error Failed to find a valid default SR for the Pool. Please provide an sr-name-label or sr-uuid parameter.
xe pool-param-set uuid=<tab> default-SR=<tab>
The SR operation cannot be performed because a device underlying the SR is in use by the host.
In my case a vgremove of the unwanted VG was enougth.

Resources