Setting a XenServer ISO Library Using NAS

Using XenCenter

  1. Open XenCenter
  2. Connect to your server
  3. Click New Storage
  4. Select Windows File Sharing (CIFS) and click Next
  5. Give the SR a name, I used NAS Storage
  6. The Share Name is actually the full path, so: \\nas301.service.softlayer.com\SLXXXXX-X
  7. Check the Use different user name checkbox and enter the user name and password for your NAS (SLXXXXX-X / MxXXXXX)AttachNAS
  8. Click Finish

Continue reading “Setting a XenServer ISO Library Using NAS”

Increasing Disk Size for a VirtualBox VM

There are 2 possible ways I know of to increase the size of a virtual drive when using VirtualBox:

  1. VBoxManage
    1. Using Windows Explorer go to C:Users<your name>VirtualBox VMs<VM Name>
    2. Make a backup of your existing VirtualBox disk file ( <disk name>.vdi )
    3. Open a command prompt as administrator
    4. cd to C:Program FilesOracleVirtualBox
    5. vboxmanage modifyhd “C:Users<your name>VirtualBox VMs<VM Name><disk name>.vdi” –resize 20000
    6. This will resize it to 20gb
  2. CloneVDI Tool
    1. Download CloneVDI from this post.
    2. Unzip it
    3. Run CloneVDI.exe as administrator
    4. Enter the source and destination
    5. Check:
      1. Increase virtual drive size to
        1. Enter the new size you would like
      2. Increase partition size
    6. Click Proceed button
    7. After the clone completes
    8. Close CloneVDI Tool
    9. Rename your old .vdi file to <orig filename>.vdi_old
    10. Rename the cloned .vdi from Clone of <filename>.vdi to <filename>.vdi

VirtualBox – Windows is shutting down…. forever!

I’ve run into a bug with VirtualBox and at least Windows XP where trying to reboot or shutdown the VM causes the shutdown process to hang at the screen displaying: Windows is shutting down. This problem has to do with mouse pointer integration.

To fix the problem:

  1. Start the VM
  2. Machine > Disable Mouse Integration
  3. Machine > Close > Save the machine state
  4. Start the VM

At this point shutting down or restarting the VM should not hang. Thanks to this post for pointing me in the right direction.

Setting the XenServer Default Storage Repository

To set the default Storage Repository (SR) in XenServer:

  1. Bring up the console
  2. Find the UUID of the pool
    1. xe pool-list
  3. Set the default SR
    1. xe pool-param-set uuid=<pool-uuid> default-SR=<sr-uuid>

You can also right click on the Storage in XenCenter and select Set as Default.

In either case, this is helpful if your default SR is the smallest disk on the server, and you are doing P2V operations.

XenDesktop and Windows XP

After enough struggling, I have learned enough to get Windows XP working within XenDesktop.

After much wrestling,
there is much rejoicing.

Here are the steps I’ve taken and the errors I’ve faced as well as the solutions to those errors:

  1. Build a Master image of XP
    1. Make sure it has enough disk on C:
  2.  Join the domain
    1. Sometimes you have to move it to a workgroup, then back to the domain, before the VM will acknowledge that it belongs to a domain.
  3. Install WinRM 2.0 which you can download from Microsoft.
  4. Install the Virtual Desktop Agent
    1. If you don’t, you will receive this error: “a duplicate name exists on the network” after running Machine Creation Services and viewing the console the created desktops in XenCenter.
  5. Make sure the storage your master image is on has enough room to be snapshot. Otherwise you will receive this misleading error:
    1. “The Catalog could not be loaded due to the following errors:
      There are no master images associated with this Catalog”
    2. To move the master image
      1. Use XenCenter to move your VM
        1. Select your VM
        2. Right click > Move VM
        3. Select a storage repository that has enough room.
  6. Use Desktop Studio to create new Catalogs and Assignments.

XenConvert Source Machine Prep

Before using XenConvert on a physical source machine, there are a couple preparations:

  1. Enable Windows Automount on Windows Server operating systems
  2. Disable Windows Autoplay
  3. Remove any virtualization software
  4. Verify adequate free space exists on the destination
  5. Remove any network interface team

Windows Automount

Use the MOUNTVOL /E command in a cmd window to enable Windows Automount

Disable Windows Autoplay

This article describes disabling Windows Autoplay (Autorun): http://support.microsoft.com/kb/967715

On Windows Server 2003 change this registry key value to FF:

HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionpoliciesExplorerNoDriveTypeAutorun

On one server, the key didn’t exist. I ignored disabling autoplay on that server and the export worked out anyway.

Remove Any Virtualization Software and Verify Adequate Space

These are obvious, uninstall VMWare, VirtualPC, VirtualBox, etc. Find a spot to drop the OVF or VHD package.

Remove Any Network Interface Team

We weren’t doing anything fancy with our interfaces, so I ignored this. I figure if you are using a Network Interface Team, you would know it. Feel free to shoot me a comment on this if you have any insight.

 

Some XenConvert Experiences

I currently have the opportunity to use the XenConvert tool to move some physical servers to our customer’s XenServer environment. I have finished moving the first server, but I had to take a couple passes before finding a successful p2v plan.

OVA to XenServer

My first plan was to export an OVA file, transfer it to an existing VM on XenServer. Then use XenCenter to import the .ova file. Using the .ova approach is done by selecting Open Virtualization Format (OVF) Package and ticking the Create Open Virtual Appliance checkbox in the XenConvert workload screen.

XenConvert OVA Options
XenConvert OVA Options

Well the XenConvert to .ova finished successfully. But importing the .ova file using XenCenter failed. It kept failing on the EULA which wasn’t defined, nor necessary to define when exporting.

This initial error using XenCenter led me to try importing with XenConvert. It was a good idea, but reality didn’t play out, and I received an error again.

VHD to XenServer

My second plan was to just export the VHD. Again using XenConvert, I select the To: XenServer Virtual Hard Disk (VHD) in the initial workload screen. Again this conversion to a .vhd file completed successfully. After transferring to the existing VM on XenServer, I immediately went to XenConvert instead of XenCenter.

In XenConvert on the initial workload screen, I selected From: Microsoft Virtual Hard Disk (VHD) and To: XenServer. Selected the .vhd file from the file system. And filled in the Hostname, User name, Password and Workspace values in the XenServer connection parameters screen:

XenConvert Connection Parms Screen
XenConvert Connection Parms Screen

This worked.

OVF to XenServer

My third plan was to export an OVF package.

XenConvert Workload
XenConvert Workload

This was never executed because the VHD approach worked. I will try this approach for the second server I am moving, so watch for updates on this post.

I have successfully imported the 3rd server using an OVF and XenConvert. I found that if the OVF fails, then the VHD method will likely fail as well. It boils down to having enough disk space to do the convert. I didn’t see much advantage to using the OVF. The OVF did allocate more RAM up front, but only provided 1 VCPU. I still had to manually configure dynamic RAM and allocate more VCPU after installing Xen Tools.

Experience

  1. Disk space, disk space, disk space. XenServer needs lots of disk in order to restore. For example, restoring a 64gb VHD required 300gb of available disk.
  2. Changing the default Storage Repository is possible with some xe commands, see this.
  3. Using OVF only allocates the correct amount of maximum RAM after the convert. User still has to manually configure dynamic memory and specify the correct number of VCPUs.

Copying VM While Running

NOTE: I receive a checksum failure error during vm-import when following this method.

To copy a VM while it is still running:

  1. Create a snapshot
  2. Export as backup
  3. Import the backup

Here are the details:

Create a Snapshot

  1. ssh into XenServer
  2. run xe vm-snapshot vm=”VM Name” new-name-label=”Name the snapshot”
  3. when it completes write down the UUID returned

Export as Backup

  1. ssh into XenServer
  2. xe template-export template-uuid=”UUID from step 3 above” filename=”Name the .xva file”
  3. View progress in XenCenter

Import the Backup

  1. ssh into XenServer
  2. xe vm-import filename=”Name the .xva file to import” sr-uuid=”SR to restore it to”

Hints:

Use df -ha to view existing disks and available space
Use xe sr-list to find the sr-uuid needed in Import the Backup step 2.