Importing VMs from XenServer 6.2

Introduction

Last year a customer asked me to migrate tens of Ubuntu machines from XenServer to OpenStack. The customer had version 6.2 running of XenServer, so in a LAB environment I built my own XenServer v6.2. I created some basic Ubuntu 12.04, 14.04 and 16.04 virtual machines with different sets of disk configurations (with and without LVM, multiple and single disks) and I exported them. I added support for VHD disks to my migration street (see Migrate to OpenStack), so I could add them in OpenStack. Unfortunately it was not that simple, I found 2 best practices for 2 issues:

  • XenServer export: Export without compression. If you want you can compress later with tools like tar.
  • Unbootable Ubuntu virtual machines (black screen after grub menu) may be fixed by the Boot-repair-disk.

Note: I did not try other Linux distributions or Windows virtual machines.

Export issues

Soon I discovered that a compressed exported (check box in the export wizard) disk is unreadable with the tools that I use. An export without compression was unusable with the libguestfs-tools, but the disks can be converted with the qemu-img convert tool. So, with a conversion to RAW or QCOW2 I could use the exported disks with the libguestfs-tools in KVM.

Broken grub?

There I hit another issue. The Ubuntu machines did not boot up completely, after Grub we had a black screen and a blinking cursor. I found out that the Boot-repair-disk fixes the issue. After further investigation I found out that the disk mounts all logical volumes, uninstalls all grub packages (grub*-common) from the virtual machines and reinstalls grub (packages: grub-pc grub-common grub-gfxpayload-lists grub-pc-bin grub2-common) from an Ubuntu repository.

Note: I discovered that this issue also applies to virtual machines that were created on XenServer 6.2 that was later upgraded to XenServer 7. I also had this issue when I tried to import the virtual machine on VirtualBox.

Offline boot-repair-disk

Our isolated migration environment does not have an Internet connection, so I had to come up with an other solution: Our own repository server with the necessary packages. A new virtual machine (Ubuntu 16.04) machine was born and resides in the same virtual network as the imported virtual machine. There are several instructions for building a repository server, like on Ubuntu Help wiki. I created 3 directories, for precise, trusty and xenial and put the deb-files (see previous) in it. The files can be downloaded from the Ubuntu repository https://packages.ubuntu.com/.

I used a customized SystemRescueCd  with a script that chroots to the vm, uninstalls grub*-common and then installs the packages from the repo server.

Migrate to OpenStack

Introduction

I migrated >120 VMware virtual machines (Linux and Windows) from VMware ESXi to OpenStack. In a lab environment I also migrated from Hyper-V with these steps. Unfortunately I am not allowed to publish the script files I used for this migration, but I can publish the steps and commands that I used to migrate the virtual machines. With the steps and commands, it should be easy to create scripts that do the migration automatically.

Just to make it clear, these steps do not convert traditional (non-cloud) applications to cloud ready applications. In this case we started to use OpenStack as a traditional hypervisor infrastructure.

 

Update 9 September 2015: The newer versions of libguestfs-tools and qemu-img convert handle VMDK files very well (I had some issues with older versions of the tools), so the migration can be more efficient. I removed the conversion steps from VMDK to VMDK (single file) and from VMDK to RAW. The migration speed will be doubled by reducing these steps.

 

Disclaimer: This information is provided as-is. I will decline any responsibility caused by or with these steps and/or commands. I suggest you don’t try and/or test these commands in a production environment. Some commands are very powerful and can destroy configurations and data in Ceph and OpenStack. So always use this information with care and great responsibility.

meer “Migrate to OpenStack”

Big brother is profiling you

Iedereen heeft wel eens gehoord dat iedere burger door overheden bespied wordt. De meesten van ons zullen niets te verbergen hebben, maar het maken van volledige profielen gaat de meeste mensen toch vrij ver. De Correspondent had een tijd geleden een aantal artikelen, waarbij in ‘Jip en Janneke’ taal wordt uitgelegd hoe dit werkt.

In dit artikel kun je lezen hoe veilig ‘versleutelde’ e-mail eigenlijk is.

Je smartphone geeft je hele leven prijs. En deze resultaten zijn alleen op basis van ‘slechts’ de metadata die volgens politici niet zoveel zegt. Je kunt je voorstellen wat bedrijven (zoals Google, Apple en Microsoft) van je weten, die ook toegang hebben tot de ‘volledige’ data.

Er worden tevens wat tips gegeven, hoewel in ieder geval één van de tips alweer achterhaald is (Truecrypt is niet veilig). Het blijft dus noodzaak om alert te blijven.