9.2 AWS to Mirantis OpenStack Express 123
9.2.1 Windows Virtual Machine Migration 123
Download the VirtIO ISO image which contains the necessary Windows drivers from this location:
http://alt.fedoraproject.org/pub/alt/virtio-win/latest/images/bin/
Save this file for use later in the process detailed below.
Unfortunately there is no ‘easy way’ to migrate a Windows Virtual Machine from AWS if you do not have Administrator Privileges on the Virtual Machine. If you don’t have Administrator Privileges, then your only option is to create a new Windows Virtual Machine on Mirantis OpenStack Express and configure the machine manually to resemble the machine on AWS.
9.2.1.1 Open ICMP through the Windows Firewall via GUI (Administrator Access)
Open a console session to the Windows Virtual Machine and allow ping (ICMP) through the Windows firewall:
1. From the Start menu, navigate to Control Panel -> System and Security and select Windows Firewall. On the left side, click Advanced Settings:
2. This will launch the Windows Firewall with Advanced Security window. In the left pane, click Inbound Rules which will show the rules in the right pane.
3. In the right pane, find the rules that are titled File and Printer Sharing (Echo Request - ICMPv4- In).
Note: For detailed instructions on configuring the Windows Firewall for others versions Windows, reference these instructions..
9.2.1.2 Open ICMP through the Windows Firewall via Command Line (Administrator Access)
Open elevated command prompt (run as administrator) type following command and press Enter:
netsh advfirewall firewall add rule name="All ICMP V4" protocol=icmpv4:any,any dir=in action=allow
(Credits for process detailed above go to from PC and Tablet.)
9.2.1.3 Configure RDP (Administrator Access)
Credits:
http://windows.microsoft.com/en-us/windows7/allow-remote-desktop-connections-from-outside- your-home-network
9.2.1.3.1 Enable Remote Desktop Connection on the Windows Virtual Machine
To permit the ability to remote desktop into the Windows Virtual Machine, you need to allow remote connections to connect to the Virtual Machine. Microsoft only supports Remote Desktop Connections on the following following versions of Windows:
● Windows XP Professional edition
● Windows Vista Business, Ultimate, or Enterprise edition ● Windows 7 Professional, Ultimate, or Enterprise edition ● Windows Server editions
On the Windows Virtual Machine, follow the following steps to enable Remote Desktop Connection:
1. Open System Information by clicking the Start button , right-clicking Computer, and then clicking Properties.
2. In the left pane, click Remote settings. If you're prompted for an administrator password or confirmation, type the password or provide confirmation.
3. Under Remote Desktop, select one of the options to allow connections. For more information about these options, see What types of Remote Desktop connections should I allow?
4. Click Select Users.
5. In the Remote Desktop Users dialog box, click Add.
6. In the Select Users or Groups dialog box, do one or more of the following: ● To specify the search location, click Locations.
● To specify the types of objects (user names) that you want to search for, click Object Types. ● In the Enter the object names to select box, type the user name that you want to search for, and
then click Check Names. If the user name isn't found, click Advanced to run an advanced search. 7. When you find the correct name, click OK.
8. The name will be displayed in the list of users in the Remote Desktop Users dialog box. 9. Click OK, and then click OK again.
9.2.1.3.2 Allow Remote Desktop Connection through the Windows Firewall If you're using Windows Firewall, follow these steps:
1. Click the Start button , click Control Panel, type "firewall" in the search box, and then click Windows Firewall.
2. Click Allow a program or feature through Windows Firewall.
3. Under Allowed programs and features, scroll down to Remote Desktop and make sure its check box is selected.
4. Under Home/Work (Private), make sure the checkbox next to Remote Desktop is selected. If you're using a non-Microsoft firewall, refer to the instructions that came with your firewall.
9.2.1.4 Install VirtIO Drivers for Windows (Administrator Access)
● Attach iso-file through system of emulations CD-ROM, eg Daemon Tools
● The installation procedure of the drivers are covered in the Red Hat documentation located here
Next, add VirtIO drivers in registry: ● Open Windows Registry Editor
○ Click the Start button , type "regedit" in the search box, and then right click click regedit.exe and select Run as Administrator.
○
Perform either the Importing of the registry configuration or the manual configuration procedure: 9.2.1.4.1 Importing registry configuration
Copy and paste the contents of Appendix C into a file with the extension of .reg
In Registry Editor, click File -> Import... and select the .reg file you saved in the previous step and click Open.
The file will import into the registry:
9.2.1.4.2 Manually entering registry configuration In Registry Editor:
● Open path:
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\CriticalDev iceDatabase\pci#ven_1af4&dev_1001&subsys_00000000]
● Change parameter "Service" to value "viostor"
● Change parameter "ClassGUID" to value "{4D36E97B-E325-11CE-BFC1- 08002BE10318}"
● Open path:
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\CriticalDev iceDatabase\pci#ven_1af4&dev_1001&subsys_00020000]
● Change parameter "Service" to value "viostor"
● Change parameter "ClassGUID" to value "{4D36E97B-E325-11CE-BFC1- 08002BE10318}"
● Open path:
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\CriticalDev iceDatabase\pci#ven_1af4&dev_1001&subsys_00021af4]
● Change parameter "Service" to value "viostor"
● Navigate through the following paths in the registry making the following changes: [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\viostor] ○ "Type"=dword:00000001 ○ "Start"=dword:00000000 ○ "Group"="SCSI miniport" ○ "ErrorControl"=dword:00000001 ○ "ImagePath"="system32\\drivers\\viostor.sys" ○ "Tag"=dword:00000021 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\viostor\Pa rameters] ○ "BusType"=dword:00000001 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\viostor\Pa rameters\MaxTransferSize]
○ "ParamDesc"="Maximum Transfer Size" ○ "type"="enum" ○ "default"="0" [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\viostor\Pa rameters\MaxTransferSize\enum] ○ "0"="64 KB" ○ "1"="128 KB" ○ "2"="256 KB" [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\viostor\Pa rameters\PnpInterface] ○ "5"=dword:00000001 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\viostor\En um] ○ "0"="PCI\\VEN_1AF4&DEV_1001&SUBSYS_00021AF4&REV_00\\3&13c0b0c5&0&20" ○ "Count"=dword:00000001 ○ "NextInstance"=dword:00000001
9.2.1.5 Add another administrator account
Open computer management:
Add new users to Administrators group
9.2.1.7 Download and install vCenter Converter Standalone
VMware vCenter Converter can be downloaded from the following link:
https://my.vmware.com/group/vmware/evalcenter?p=converter
Warning!
Image file must be created on the volume that was previously added. Do not write to the system disk!!!
When the conversion process is complete, you will have a VMDK file of the Virtual Machine from AWS.
After downloading the VMDK image from the datastore, you need to place it on a Linux system to utilize the qemu-img tools to convert it to the appropriate QCOW2 format. You can create a Linux Virtual Machine and install the qemu-img package or you can utilize the Controller Node of your OpenStack environment. See creating an unprivileged user of this document for
obtaining access to the Controller Node of Mirantis OpenStack Express and uploading the VMDK image.
NOTE: If your VMDK is a large file, ensure that there is at least 2.5x the space available on your Controller Node before uploading it to the controller node.
Upload the VMDK file to the Controller Node (or optionally a VM that has both the qemu-img) to the mirantis user home directory.
SSH in as the mirantis user and convert the VMDK to a QCOW2 format by issuing the following command:
qemu-img convert -f {initial format} -O {target format} {source file} {destination file}
9.2.1.9 Inject VirtIO drivers
If you are running guestfish on the Controller Node, you need to execute the following line so that guestfish knows where to locate qemu-kvm binary, otherwise you will have issues: export LIBGUESTFS_QEMU=$(rpm -ql qemu-kvm | grep qemu-kvm$)
Upload the following files to the same location that you stored the VMDK file in the previous section:
● VirtIO ISO file (Downloaded at the start of the Windows Virtual Machine migation section) ● All oem* files you copied out of the Virtual Machine prior to powering it off
First, SSH in as root and mount the VirtIO ISO so we can copy files out of it: [root@node-2 ~]# mkdir -p /mnt/virtio
[root@node-2 ~]# mount -t iso9660 -o loop ~mirantis/virtio-win-0.1- 74.iso /mnt/virtio
Next SSH in as the mirantis user and create a folder structure to be used to inject the VirtIO drivers into the QCOW2 image using guestfish:
mkdir -p ~/Drivers/inf ~/Drivers/system32/drivers Copy the files from the win7/amd64 directory into the inf folder:
[mirantis@node-2 ~]$ cp /mnt/virtio/win7/amd64/* Drivers/inf >/dev/null
[mirantis@node-2 ~]$ ls Drivers/inf/
balloon.cat balloon.sys netkvm.cat netkvm.pdb vioscsi.cat vioscsi.sys vioser.pdb vioser-test.pdb viostor.pdb
balloon.inf blnsvr.exe netkvmco.dll netkvm.sys vioscsi.inf vioser.cat vioser.sys viostor.cat viostor.sys
balloon.pdb blnsvr.pdb netkvm.inf readme.doc vioscsi.pdb vioser.inf vioser-test.exe viostor.inf
wdfcoinstaller01009.dll [mirantis@node-2 ~]$
Next copy the oem* files into place:
[mirantis@node-2 ~]$ cp oem* Drivers/inf/ [mirantis@node-2 ~]$ ls Drivers/inf/
balloon.cat blnsvr.exe netkvm.inf oem2.PNF oem4.PNF oem6.PNF vioscsi.pdb vioser.pdb viostor.cat wdfcoinstaller01009.dll
balloon.inf blnsvr.pdb netkvm.pdb oem3.inf oem5.inf readme.doc vioscsi.sys vioser.sys viostor.inf
balloon.pdb netkvm.cat netkvm.sys oem3.PNF oem5.PNF vioscsi.cat vioser.cat vioser-test.exe viostor.pdb balloon.sys netkvmco.dll oem2.inf oem4.inf oem6.inf vioscsi.inf vioser.inf vioser-test.pdb viostor.sys [mirantis@node-2 ~]$
Lastly, store these files into the Drivers folder:
[mirantis@node-2 ~]$ for X in balloon.sys netkvm.sys vioscsi.sys vioser.sys viostor.sys; do cp /mnt/virtio/win7/amd64/${X}
Drivers/system32/drivers; done [mirantis@node-2 ~]$ ls Drivers/system32/drivers/* Drivers/system32/drivers/balloon.sys Drivers/system32/drivers/vioscsi.sys Drivers/system32/drivers/viostor.sys Drivers/system32/drivers/netkvm.sys Drivers/system32/drivers/vioser.sys [mirantis@node-2 ~]$
Now we will create a quick bash shell script to perform the injection. Launch your favorite editor (nano, emacs, vi, etc) and copy/paste the following into a script called inject.sh:
#!/bin/bash
guestfish --rw -a $1 -i <<_EOF_
upload Drivers/Inf/BALLOON.CAT 'win:\windows\inf\BALLOON.CAT' upload Drivers/Inf/BALLOON.INF 'win:\windows\inf\BALLOON.INF' upload Drivers/Inf/BALLOON.PDB 'win:\windows\inf\BALLOON.PDB' upload Drivers/Inf/BALLOON.SYS 'win:\windows\inf\BALLOON.SYS' upload Drivers/Inf/BLNSVR.PDB 'win:\windows\inf\BLNSVR.PDB' upload Drivers/Inf/NETKVM.CAT 'win:\windows\inf\NETKVM.CAT' upload Drivers/Inf/NETKVMCO.DLL 'win:\windows\inf\NETKVMCO.DLL'
upload Drivers/Inf/NETKVM.PDB 'win:\windows\inf\NETKVM.PDB' upload Drivers/Inf/NETKVM.SYS 'win:\windows\inf\NETKVM.SYS' upload Drivers/Inf/oem2.inf 'win:\windows\inf\oem2.inf' upload Drivers/Inf/oem2.PNF 'win:\windows\inf\oem2.PNF' upload Drivers/Inf/oem3.inf 'win:\windows\inf\oem3.inf' upload Drivers/Inf/oem3.PNF 'win:\windows\inf\oem3.PNF' upload Drivers/Inf/oem4.inf 'win:\windows\inf\oem4.inf' upload Drivers/Inf/oem4.PNF 'win:\windows\inf\oem4.PNF' upload Drivers/Inf/oem5.inf 'win:\windows\inf\oem5.inf' upload Drivers/Inf/oem5.PNF 'win:\windows\inf\oem5.PNF' upload Drivers/Inf/oem6.inf 'win:\windows\inf\oem6.inf' upload Drivers/Inf/oem6.PNF 'win:\windows\inf\oem6.PNF'
upload Drivers/Inf/VIOSCSI.CAT 'win:\windows\inf\VIOSCSI.CAT' upload Drivers/Inf/VIOSCSI.INF 'win:\windows\inf\VIOSCSI.INF' upload Drivers/Inf/VIOSCSI.PDB 'win:\windows\inf\VIOSCSI.PDB' upload Drivers/Inf/VIOSCSI.SYS 'win:\windows\inf\VIOSCSI.SYS' upload Drivers/Inf/VIOSER.CAT 'win:\windows\inf\VIOSER.CAT' upload Drivers/Inf/VIOSER.INF 'win:\windows\inf\VIOSER.INF' upload Drivers/Inf/VIOSER.PDB 'win:\windows\inf\VIOSER.PDB' upload Drivers/Inf/VIOSER.SYS 'win:\windows\inf\VIOSER.SYS'
upload Drivers/Inf/VIOSER-TEST.PDB 'win:\windows\inf\VIOSER-TEST.PDB' upload Drivers/Inf/VIOSTOR.CAT 'win:\windows\inf\VIOSTOR.CAT'
upload Drivers/Inf/VIOSTOR.INF 'win:\windows\inf\VIOSTOR.INF' upload Drivers/Inf/VIOSTOR.PDB 'win:\windows\inf\VIOSTOR.PDB' upload Drivers/Inf/VIOSTOR.SYS 'win:\windows\inf\VIOSTOR.SYS' upload Drivers/Inf/WDFCOINSTALLER01009.DLL 'win:\windows\inf\WDFCOINSTALLER01009.DLL' upload Drivers/system32/drivers/BALLOON.sys 'win:\windows\system32\drivers\BALLOON.sys' upload Drivers/system32/drivers/netkvm.sys 'win:\windows\system32\drivers\netkvm.sys' upload Drivers/system32/drivers/vioscsi.sys 'win:\windows\system32\drivers\vioscsi.sys' upload Drivers/system32/drivers/vioser.sys 'win:\windows\system32\drivers\vioser.sys' upload Drivers/system32/drivers/viostor.sys 'win:\windows\system32\drivers\viostor.sys' quit _EOF_
Press Ctrl+D and and launch the script passing the file name of the QCOW2 file: ./inject.sh ./vm.qcow2
Now we will prepared a reg file for registry injection:
Create text file and name it “virtio.reg” with file following text: Windows Registry Editor Version 5.00
"Service"="viostor" "ClassGUID"="{4D36E97B-E325-11CE-BFC1-08002BE10318}" [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\CriticalDeviceDataba se\pci#ven_1af4&dev_1001&subsys_00020000] "Service"="viostor" "ClassGUID"="{4D36E97B-E325-11CE-BFC1-08002BE10318}" [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\CriticalDeviceDataba se\pci#ven_1af4&dev_1001&subsys_00021af4] "Service"="viostor" "ClassGUID"="{4D36E97B-E325-11CE-BFC1-08002BE10318}" [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\viostor] "Type"=dword:00000001 "Start"=dword:00000000 "Group"="SCSI miniport" "ErrorControl"=dword:00000001 "ImagePath"="system32\\drivers\\viostor.sys" "Tag"=dword:00000021 [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\viostor\Parameters] "BusType"=dword:00000001 [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\viostor\Parameters\ MaxTransferSize]
"ParamDesc"="Maximum Transfer Size" "type"="enum" "default"="0" [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\viostor\Parameters\ MaxTransferSize\enum] "0"="64 KB" "1"="128 KB" "2"="256 KB" [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\viostor\Parameters\ PnpInterface] "5"=dword:00000001 [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\viostor\Enum] "0"="PCI\\VEN_1AF4&DEV_1001&SUBSYS_00021AF4&REV_00\\3&13c0b0c5&0&20" "Count"=dword:00000001 "NextInstance"=dword:00000001
The above reg file is also available on Google Drive here:
Injected it via command:
virt-win-reg --merge {Disk name}.qcow2 {file name} Example: virt-win-reg --merge VM.qcow2 virtio.reg
At this point you are ready to upload your image to OpenStack. Since you’re already logged into the Controller Node, utilize the CLI to perform the upload as detailed in the upload images
section.
Horizon:
● Сreate a new instance from image WIN2K8R2.qcow2 ● Click button +Launch Instance
● Choose network ● Click button Launch
● To work with the virtual machine open Console