CloudStack And XenServer vhd-util

Update: 20140414: Newer Cloudstack installations might need vhd-util top be copied to /opt/cloud/bin/ manually on the XenServer. It exists on my installations. YMMV

A frequently asked question on the CloudStack mailing list is whether CloudStack 4.2 supports XenServer 6.2 as many users have faced problems adding XenServer hosts into their CloudStack infrastructure.

The answer is an emphatic YES. CloudStack 4.2.0 is the first release of CloudStack to fully support XenServer 6.2 and works very well.

Most of the integration issues faced by users seems to be around 2 missing steps:

  1. Failed to download vhd-util to /usr/share/cloudstack-common/scripts/vm/hypervisor/xenserver/vhd-util on the CloudStack management server BEFORE adding the XenServer hosts. /usr/share/cloudstack-common/scripts/vm/hypervisor/xenserver/vhd-util is the only location where vhd-util is required to be present. CloudStack management server will automatically copy vhd-util to the XenServer hosts when you add them
  2. Failed to create XenServer traffic labels using either XenCenter Windows Tool or the “/opt/xensource/bin/xe network-param-set” command line interface BEFORE adding the host

Both of these steps are well documented in the XenServer Installation for CloudStack section of the Installation Guide.

Adding a XenServer host to CloudStack is really simple once the vhd-util and traffic labels steps are completed:

  1. Install XenServer hosts from the Installation ISO
  2. Create a XenServer pool. Really simple if you use XenCenter on a Windows host
  3. Set the traffic labels. Use XenCenter or via “xe” CLI
  4. Add the pool master as the first host into CloudStack. CloudStack will automatically add the remaining hosts from the pool. Of course, if you dont have a pool, just add the XenServer host individually.

And that’s all there is to it.

Update #1 (20140414)

To make debugging easier, below are some additional information pertaining to vhd-util:

  1. The vhd-util binary already exists on a XenServer 6.2 installation as /usr/bin/vhd-util and is part of the XenServer package blktap-2.0.90.xs733-xs6.2.0.
    [root@vxen1-2 ~]# whereis vhd-util
    vhd-util: /usr/bin/vhd-util /opt/xensource/bin/vhd-util /opt/cloud/bin/vhd-util
    [root@vxen1-2 ~]# rpm -qf /usr/bin/vhd-util
    [root@vxen1-2 ~]# ls -l /usr/bin/vhd-util
    -rwxr-xr-x 1 root root 5908 Nov 28 20:09 /usr/bin/vhd-util
    [root@vxen1-2 ~]# ls -l /opt/xensource/bin/vhd-util
    -rwxr-xr-x 1 root root 318977 Dec 20 22:21 /opt/xensource/bin/vhd-util
    [root@vxen1-2 ~]# ls -l /opt/cloud/bin/vhd-util
    -rwxr-xr-x 1 root root 318977 Jan 11 10:12 /opt/cloud/bin/vhd-util
  2. /usr/bin/vhd-util binary from the blktap RPM is very different than the one available from the as /usr/bin/vhd-util supports the -S option for create. Certain CloudStack operations might require the -S option to work correctly.

    [root@vxen1-2 ~]# /usr/bin/vhd-util create
    options: <-n name> <-s size (MB)> [-r reserve] [-h help] [<-S size (MB) for metadata preallocation (see vhd-util resize)>]
    [root@vxen1-2 ~]# /opt/cloud/bin/vhd-util create
    options: <-n name> <-s size (MB)> [-r reserve] [-h help]

By Shanker Balan

Shanker Balan is a devops and infrastructure freelancer with over 14 years of industry experience in large scale Internet systems. He is available for both short term and long term projects on contract.

Please use the Contact Form for any enquiry.

5 replies on “CloudStack And XenServer vhd-util”

Very informative specially for new people exploring virtualization.
Kindly do more of these stuff, good job! Thanks!

Hi Hug,

I did see this bug being mentioned on the mailing list. I haven’t run into this issue on my setup probably because I use NFS for my primary store.

The CloudStack mailing list(s) would be a better place to find a solution.


Leave a Reply

Your email address will not be published. Required fields are marked *