Eucalyptus Windows EMI Creation from VMDK
This article shows you how to create a virtual machine image from a Windows OS in VMware and convert it for use in Eucalyptus Enterprise Edition (EE). The resulting disk image can be bundled, uploaded, and registered with Eucalyptus. Eucalyptus EE is compatible with images created from licensed versions of Windows Server 2003, Windows Server 2008, and Windows 7. For instructions on running and managing Windows images in Eucalyptus EE, see the Eucalyptus Enterprise Edition User’s Guide. (Note that these instructions pertain to Windows VMDK’s only. For conversion of Linux based VMDK’s, please contact Eucalyptus Professional Services).
Prerequisites
In addition to the requirements contained in the steps for creating a Windows Image (see The Eucalyptus Administrator’s Guide; Appendix A: Creating a Windows Image for Eucalyptus) please make sure your image meets the following prerequisites:
?One network interface
?One disk (must be first IDE disk)
Before you begin, make sure that Eucalyptus Enterprise Edition with Windows VM support is properly installed and licensed (see The Eucalyptus Administrator’s Guide; Section 3: Installing Eucalyptus). About Windows Images
Windows is sensitive to physical and virtual hardware changes made after installation. Thus we advise creating the Windows image on the ESX/ESXi where you plan to run instances of the Windows image.
In addition, to support AWS methods for running Windows instances with randomized Administrative passwords (accessible through EC2 calls), a few extra steps must be followed when preparing the image, as detailed below.
Step 1: Install base Windows OS
1.Create a new VM using the VMware vSphere Client following the standard VMware procedures. Note
that you must create the image using the LSI Logic Parallel driver.
2.Install the Windows OS following standard VMware procedures.
3.Install VMware Tools.
Step 2: Prepare Windows VM for customization
Note: Power on the VM and connect to the console via the VMware vSphere Client.
https://www.doczj.com/doc/b0681564.html,ing VMware vSphere Client, copy /usr/share/eucalyptus/floppy to a datastore that is visible to the
VM.
2.Connect the floppy to the VM through the VMware vSphere Client.
Step 3: Enable ACPI Shutdown
The next step is to enable ACPI Shutdown using the Windows Group Policy Editor.
1.Start > run: gpedit.msc
2.Navigate to: Computer Configuration > Windows Settings > Security Settings > Local Policies >
Security Option
3.Select “Allow system to be shutdown without having to log on”.
4.Reboot the guest.
Step 4: Configure the VM to support AWS Password/RDP functionality (Optional)
An Amazon AWS Windows instance boots up with a single user (Administrator) and provides a unique (randomized) password for each instance with Microsoft’s Remote Desktop Protocol (RDP) enabled.
After installing a Windows VM, you must configure the VM so that it generates a random Administrator password at boot time and you must enable RDP. This two-step process is slightly different for each version of Windows, as shown below:
Windows 2003:
1.Setup randomized password at boot time:
a.Copy euca.bat from the floppy (a:) to the C:\
b.Add a “New Task” that runs “c:\euca.bat (or other path to euca.bat) on “When My Computer
Starts” (as Administrator).
2.Enable Remote Desktop Protocol (RDP)
a.Start > right-click on “My Computer” > select “Properties” > Remote Tab
b.Check the “Enable Remote Desktop” checkbox
Windows 2008:
1.Setup randomized password at boot time:
a.Copy euca.bat from the floppy (a:) to the C:\
b.Start > Administrative Tools > Task Scheduler
c.In the “Actions” windows (right pane) click on “Create Basic Task”. The Create Basic Task wizard
opens.
d.In the “Name” field enter: “Random Boot Password”. Click Next.
e.In the “Trigger” menu, select the “When the computer starts” radio button.
f.Click Next.
g.In the “Action” menu, select the “Start a program” radio button, Click next.
h.In the “Program/script” enter “c:\euca.bat” (or other path to euca.bat). Click next.
i.Check “Open the Properties” dialog for this task when I click Finish. Click Finish
j.In the Properties window, select these options: “Run whether user is logged in or not” and “Run with highest privileges”.
k.Add current Administrator password to ensure the script will run at boot.
2.Enable Remote Desktop Protocol (RDP)
a.Start > right click “My Computer” > Properties > Remote Settings.
b.Check the “Allow connections from computers running any version of Remote Desktop”
checkbox.
c.Ensure firewall is disabled (If firewall is enabled, then ensure that RDP connections are permitted
through the firewall).
Windows 7:
1.Setup randomized password at boot time:
a.Start > All Programs > Accessories > System Tools > Task Scheduler
b.In the “Actions” windows (right pane) click on “Create Basic Task”. The Create Basic Task wizard
opens.
c.In the “Name” field enter: “Random Boot Password”. Click Next.
d.In the “Trigger” menu, select the “When the computer starts” radio button.
e.Click Next.
f.In the “Action” menu, select the “Start a program” radio button, Click next.
g.In the “Program/script” enter “c:\euca.bat” (or other path to euca.bat). Click next.
? 2010 Eucalyptus Systems, Inc.
6755 Hollister Ave. Ste. 200, Goleta, CA 93117
805-845-8000
https://www.doczj.com/doc/b0681564.html,
Last modified: 1/27/11Page 2
h.Check “Open the Properties” dialog for this task when I click Finish. Click Finish
i.In the Properties window, select these options: “Run whether user is logged in or not” and “Run
with highest privileges”.
j.Add current Administrator password to ensure the script will run at boot.
2.Enable Remote Desktop Protocol (RDP)
a.Start > right click “Computer” > Properties > Remote Settings.
b.Check the “Allow connections from computers running any version of Remote Desktop”
checkbox.
c.Ensure firewall is disabled (If firewall is enabled, then ensure that RDP connections are permitted
through the firewall).
Step 5: Shut down the Windows VM
Shutdown the Windows VM you created in the above steps.
Step 6: Converting the VMDK to EMI
Note: Make sure that the Windows VM is powered off as in step 5 above.
1.Log into the CC/VMware Broker machine and, if necessary, set the appropriate environment
variables:
# export VDDK_HOME=/opt/packages/vddk/
# export EUCALYPTUS=/
# export LD_LIBRARY_PATH=/opt/packages/vddk/lib/vmware-vix-disklib/lib64/ # PATH=/usr/lib/eucalyptus/:$PATH
# cd ~/.euca (or path to .eucarc)
# source .eucarc
https://www.doczj.com/doc/b0681564.html,e the euca_imager tool to extract and convert the VMDK to a raw disk image. This tools helps
convert a remote VMDK located on a datastore into a disk image on the local disk on the CC/VMware Broker machine. Specific parameters are required for this process. This parameters are described in the following table:
contacting an ESX node directly, but may be required when contacting vCenter.
The following example shows euca_imager with the appropriate parameters as described above converting a VMDK to a raw disk image. Make sure the prefix of the “out” parameter (i.e., name of disk) begins with the word “windows”:
Note: The above input is typed as one long command
Step 7: Adding a VMware-based image for use in Eucalyptus
Use the following Euca2ools commands to add the image to Eucalyptus (in the following commands, the
1.# euca-bundle-image –i
2.# euca-upload-bundle –b
xxxx.manifest.xml is from the output of #1 above)
3.#euca-register file>.manifest.xml is from the output of #2 above) Example: ? 2010 Eucalyptus Systems, Inc. 6755 Hollister Ave. Ste. 200, Goleta, CA 93117 805-845-8000 https://www.doczj.com/doc/b0681564.html, Last modified: 1/27/11Page 4