A few months ago I had a requirement which was move an virtual machine with CentOS 7.2.1511 virtualized it at Hyper-v 10.0.14393.0 to Oracle IaaS.
In first place everything was well but when I uploaded the image.tar.gz in Oracle IaaS Console was showing the next error:
[ [32m OK [0m] Started Show Plymouth Boot Screen.
[ [32m OK [0m] Reached target Paths.
[ [32m OK [0m] Reached target Basic System.
%G[ 2.263078] tsc: Refined TSC clocksource calibration: 2992.789 MHz
[ 2.473407] input: ImExPS/2 Generic Explorer Mouse as /devices/platform/i8042/serio1/input/input3
[ 124.435211] dracut-initqueue[258]: Warning: dracut-initqueue timeout - starting timeout scripts
[ 124.947098] dracut-initqueue[258]: Warning: dracut-initqueue timeout - starting timeout scripts
For to continue I describe my configuration:
Tools to use.
Hyper-v Hypervisor
Qemu-img utility
The Machine virtualized it in Hyper-v had vhdx format.
How to prepare the machine?
- In "fstab file" verify that doesn´t exist external discs. comment or delete.
- Edit the "ifcfg-eth0 file":
# vi /etc/sysconfig/network
BOOTPROTO="dhcp"
ONBOOT=yes
TYPE="Ethernet"
USERCTL="yes"
PEERDNS="yes"
IPV6INIT="no"
PERSISTENT_DHCLIENT="1"
- service network restart
- Edit the "network file":
# vi /etc/sysconfig/network
NETWORKING=yes
NOZEROCONF=yes
# vi /etc/default/grub
GRUB_CMDLINE_LINUX="crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap console=tty0 console=ttyS0,115200"
# grub2-mkconfig -o /boot/grub2/grub.cfg
How to converter the Virtual Machine to raw format?
Now. For to avoid the error:
[ 124.947098] dracut-initqueue[258]: Warning: dracut-initqueue timeout - starting timeout scripts .
.
.
is very, very important add "dracut drivers" before to converter the image.
- In the Virtual Machine CentOS 7 virtualized it Hyper-v, open a terminal an execute the next command:
# dracut --add-drivers "xen-blkfront xen-netfront" -force
qemu-img convert -f vhdx C:\Users\PC\Documents\Machines\centos1\Virtual" "Hard" "Disks\centos1.vhdx -O raw C:\Users\PC\Documents\Machines\centos1\Virtual" "Hard" "Disks\centos1.img
- Now is necesary package the image created in tar format because is the format that Oracle IaaS accepted.
# tar -czvf centos1.raw.tar.gz centos1.img
Ready! Now upload the tar file to Oracle IaaS and you create an virtual Machine with the procedure mentioned
here.
If you need to use private keys for authenticate execute the next commands before convert the vhdx file to raw format as mentioned
here.
# yum install acpid
# systemctl enable acpid
# yum install cloud-init
# yum install cloud-utils-growpart
I hope will be useful for someone.
Regards!