Quickie: VirtualBox Xen Conversion


converting a copy of a Virtualbox image for transfering to Xen host.
This is just a brain dump, but if you run into this scenario it’ll be enough for you to work with.

I didn’t see a way to have VBoxManage write to stdout.

Clonehd and the UUID

floh@egal:/scratch/convert$ VBoxManage clonehd opennebula-3.8-sandbox.vdi\
 opennebula-3.8-sandbox.img -format RAW
VBoxManage: error: Cannot register the hard disk 
'/scratch/convert/opennebula-3.8-sandbox.vdi'
{fd6db816-whatever} because a hard disk '/scratch/opennebula-3.8-sandbox.vdi'
with UUID {fd6db816-whatever} already exists

floh@egal:/scratch/convert$ VBoxManage internalcommands \
sethduuid opennebula-3.8-sandbox.vdi 
UUID changed to: d3faa73c-blah

floh@egal:/scratch/convert$ VBoxManage clonehd opennebula-3.8-sandbox.vdi \
opennebula-3.8-sandbox.img -format RAW
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Clone hard disk created in format 'RAW'. UUID: b58d3fc1-blah

Conversion is only IO-speed dependant, I did it on a single laptop HDD instead of SSD or BBU’ed raid. If you’re working with more than 10GB, use something fast.

Create LV on Remote host

[root@localhost ~]# lvcreate -L 10240 -n lvonefe vgxen_raid10
  Logical volume "lvonefe" created

Transfer:

Transfer speed is always limited by SSH, unless you have Alpine Linux with HPN-SSH 🙂 You can also switch ssh ciphers for bulk transfer. My “home box” doesn’t use Alpine Linux yet; I switch to blowfish.

floh@egal:/scratch/convert$ dd if=opennebula-3.8-sandbox.img bs=1024k | 
ssh -c blowfish root@192.168.10.60 "dd of=/dev/vgxen_raid10/lvonefe bs=1024k"
root@192.168.10.60's password:

Still only got a sad 36MB/s.
Retrying the same with compression enabled (-C) yields no improvement.

SSH? NFS ftw.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s