3 Conformabilidad en conformado incremental mono-punto (SPIF)
3.2 Deformaciones límite en SPIF
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.
If you have access to the administrator account on the Virtual Machine, proceed with opening ICMP through the Windows Firewall, however if you do not have Administrator access:
● Log into the Virtual Machine as an unprivileged user ● Navigate to C:\Windows\inf
● Copy all of the oem* files from that directory out of the virtual machine to someplace you can get them after shutting the virtual machine down
At this point proceed with copying the VMDK files.
9.3.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).
4. Right-click each rule and select Enable Rule:
Note: For detailed instructions on configuring the Windows Firewall for others versions Windows, reference these instructions.
9.3.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.3.1.3 Configure RDP (Administrator Access)
Credits:
http://windows.microsoft.com/en-us/windows7/allow-remote-desktop-connections-from-outside- your-home-network
9.3.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.3.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.
First mount the VirtIO ISO image that was downloaded at the start of the Windows Virtual Machine section of this document.
● 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.3.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.3.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.3.1.5 Copy VMDK Files
First, shutdown the virtual machine and then obtain the VMDK files that make up the virtual machine. To locate these files, select Edit Settings on the Virtual Machine in vCenter and click on the Hard Disk to see the location of the file:
Note: If the Virtual Machine has multiple hard disks allocated to it, the process to migrate it into OpenStack becomes more complicated. If you wish to attempt this, please refer to this:
https://ask.openstack.org/en/question/5358/how-to-import-a-vmware-vm-with-multiple-drives/
Copy the VMDK file from the datastore:
Note: If your Virtual Machine was created in VMWare Workstation or VMware Fusion, it’s possible you don’t have a single *-flat.vmdk that you need and instead have multiple VMDK files that make up the single disk:
If this is the case, you will require the Virtual Disk Development Kit from VMware available here:
https://www.vmware.com/support/developer/vddk/
See Appendix B for installation and usage of the toolkit to merge the multiple VMDK files into a single flat VMDK.
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 the Navigating Mirantis OpenStack Express section 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}
If you had administrator access to this Windows Virtual Machine, you are ready to upload your image to OpenStack as detailed in the uploading image to OpenStack section of this document. If you did not have Administrator access to this Windows Virtual Machine, you must proceed with the steps in the next section.
9.3.1.6 Inject VirtIO drivers (No Administrator Access)
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 copy the VMDK files section of this document:
● VirtIO ISO file (Downloaded at the start of the Windows Virtual Machine section of this document ● 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.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.INF 'win:\windows\inf\NETKVM.INF' 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
Create text file and name it “virtio.reg” with file following text: Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\CriticalDeviceDataba se\pci#ven_1af4&dev_1001&subsys_00000000] "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]
"Count"=dword:00000001
"NextInstance"=dword:00000001 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 validating
authentication section of the document. ● Horizon:
● Сreate a new instance ● Stop instance
● Replace instance’s hard disk drive into the prepared disk ● nova reboot or nova start instance