Using Virtual Machines

Experiments in Xen or How to Add a Drive in DomU

Thu, 05/17/2012 - 10:19am

We are embarking on a new direction in Virtual Machines. We have been running VMware for the last 4 years. It has not been the happiest of relationships. I like access to the Command Line, and they keep attempting to take that away. So, off to play with Xen for a while.

I have setup a XenServer environment and been doing a little testing and work with it. Of course, one of our primary desires will be to migrate off the old VMware environments. Citrix has a tool for migration that has worked nicely with our first attempt. The missing piece for me however, is that this linux image had 2 drives. The migration tool moved the first drive, but ignored the second.

That was a bit of a problem :)  --  So here is what I had to do to migrate the additional drive. I pulled this from reading some of the materials, but since their vocabulary is a bit different, I'm not sure this is the 'approved' method. The most difficult issue to me was a complete lack of documentation on the web. This is one of those times where you might begin to doubt your Google skills.  All the results to my queries bring up answers about adding a drive to Dom0 and I wanted to know how to do it for DomU. (Xen terms for the base OS 'Dom0' and the guest OS's 'DomU'). 

The Solution:

I built a VM and named it Converter. This is a Debian 6 with the package qemu installed. Then I ran:
# qemu-img convert git_2-flat.vmdk -O raw git_2.img

Once that completed, I moved the img file to my Dom0 image and ran the following:
# xe vdi-create sr-uuid=<UUID of SR> name-label=git_repo type=user virtual-size=30GiB
This outputs a new UID for the disk which is used in the next command:
# xe vdi-import uuid=<UUID output from previous command> filename=work-klv/git_2.img

Once this was done, a quick trip to XenCenter and I attached the newly visible drive in the 'storage' tab of my VM.

Share this

Our Web development team has developed thousands of websites for clients, both local and national.

We would love to help you in your business.

855.243.2035

Phone Icon

Contact Us

email icon