XenServer 5.0 SDKs Released to Web

Incase you haven’t heard, the XenServer 5.0 SDKs have been released. Here’s a short summary of them:

  • New XenServerPSSnapIn: This is the PowerShell snap-in for XenServer, which is a one-to-one mapping of the existing XenServer API. It should be noted that the functionality in XenServerSnapshotPSSnapIn can be duplicated with this, however it will take many lines of scripting. You can use both snap-ins together if you’d like to manage your XenServers and take snapshots via PowerShell.
  • Updated XenServer.NET: The XenServer SDK for .NET
  • Updated XenServerJava: The XenServer SDK for Java
  • Updated libxenserver: The XenServer SDK for C
  • Updated XenAPI.py: The XenServer Python module

The SDKs can be downloaded from Citrix Community. Enjoy!

Citrix Summit 2008 Pics

A couple of weeks ago I was at Citrix Summit 2008, which is a trade show that partners can attend to learn about our latest technologies. This year it was in Orlando, FL at the Walt Disney World Dolphin and Swan Resort.

One of the most popular events at Summit (and Synergy) is Tech Lab. This is where you can walkaround and see demos of the latest stuff from Citrix (such as Project Apollo) and third-party vendors. Here is the Citrix Tech Lab team:

Citrix Summit 2008 Tech Lab Team

More pictures of Summit can be found here.

Cloning a XenApp server with EdgeSight

I’ve received some feedback on using XenAppPrep with EdgeSight and I thought it would be beneficial to share some information on this topic.

The current version of XenAppPrep was designed to address the cloning process for XenApp core. This does not include any of the XenApp Platinum components, however we are planning to enhance the tool to cover all of them. In the meantime, you can use the following steps to clone a XenApp server with EdgeSight:

  1. Install XenApp.
  2. Install EdgeSight by running msiexec /i EdgeSightEPAgent.msi SERVICE_START_MANUAL=”1″. This will install the EdgeSight service in Manual start-up mode. Do not start this service before an image is taken.
  3. Install and run XenAppPrep.
  4. Set the Citrix System Monitoring Agent (RSCorSvc) service to Automatic start-up.
  5. Take an image of the server or if you’re using Provisioning Server switch the workload to standard image mode.

It’s important to ensure the Citrix System Monitoring Agent (RSCorSvc) service has never been started before an image is taken. If it has, the following steps must be taken before imaging the server:

  1. Stop the Citrix System Monitoring Agent (RSCorSvc) service.
  2. Uninstall the EdgeSight Agent.
  3. Ensure HKLM\SOFTWARE\Citrix\System Monitoring key has been removed.
  4. Verify the EdgeSight Agent database has been removed. It’s default location is C:\Documents and Settings\All User\Application Data\Citrix\System Monitoring\Data\rsdatr.fdb.
  5. Reinstall the EdgeSight Agent with the instructions above.

Joining the XenApp MX team

Since March 2006 I’ve been working on the XenApp Automation team, leading and technically contributing to many automated test suites. Prior to this I worked at a defense contractor for a few years in both IT and software engineering capacities. The Automation team has been focused on enabling Citrix to release new high quality versions of XenApp more often by automating tests. During this time, I learned a lot about XenApp and the software release processes at Citrix. I’ve also learned that I’d like to have a more direct impact on customers and get more involved technically.

So a little over a month ago I joined the XenApp Management Experience (MX) team. We develop the infrastructure and tools, such as the Access Management Console (AMC), that allow IT departments to easily manage their farms. The team has a lot of experience, technical involvement, and interesting challenges to solve. Initially I will be ramping the team up with their automation processes, infrastructure, and tests. But after this I’m expected to develop some the new management features that will be in the next version of XenApp.

There’s a long road ahead of us. We have a lot of work to get done for XenApp vNext and there’s a lot of room for innovation and new ideas. Best of all, there’s a lot of energy on the team to only do the best. With that said, I’m excited about the projects I’ll be working on and customers we’ll be helping! If you have any ideas that would improve the XenApp management experience, I’d love to hear about them.

Hot Off the Compiler: PowerShell SnapIn for XenServer Snapshots

As a follow-up to my Snapshotting with the XenServer 5.0 SDK post, I’ve written a PowerShell snapin that will allow you to take and revert snapshots with XenServer. You can download the source code and binaries here. You must have the .NET Framework 3.5 installed before you can use it. To install the snapin you will need to run the following command after you’ve downloaded and extracted the ZIP file:

C:\Windows\Microsoft.NET\Framework\v2.0.50727\InstallUtil.exe /i XenServerSnapshotPSSnapIn.dll

Then you can open up your PowerShell console and enter the following to take a snapshot of your virtual machine named Bluemoon, which by the way is my favorite beer!

Add-PSSnapin XenServerSnapshot*
Checkpoint-VM -Hostname 192.168.0.2 -Username root -Password qwerty -VM Bluemoon -Snapshot BluemoonBackup

If you decide you’d like to revert to this snapshot you can do this:

Restore-VM -Hostname 192.168.0.2 -Username root -Password qwerty -VM Bluemoon -Snapshot BluemoonBackup

And before I leave the office for the night, here are a few things to note:

  • The cmdlets return true if they were able to execute successfully, otherwise they return false.
  • Virtual machine names are case-sensitive.
  • PowerShell must be installed to compile the source. XenAPI.net is included with the download.
  • I’ve made a few tweaks to this code from the original version.

Added 09-March-2009: The snapshot feature in XenServer requires a VHD-on-EXT3 storage repository.  To change the default repository to EXT3, please see http://support.citrix.com/article/ctx116324.  Alternatively, the following script can be used:

dev=`cat /etc/xensource-inventory | grep DEFAULT_SR_PHYSDEVS | cut -d ‘=’ -f2 | grep -o -E “[^'].*[^']“`

sr_uuid=`xe sr-list type=lvm | grep uuid | cut -d ‘:’ -f2 | cut -c 2-`

pbd_uuid=`xe pbd-list sr-uuid=$sr_uuid | grep -E ‘^uuid.*’ | cut -d ‘:’ -f2 | cut -c 2-`

inst_uuid=`cat /etc/xensource-inventory | grep INSTALLATION_UUID | cut -d ‘=’ -f2 | grep -o -E “[^'].*[^']“`

xe pbd-unplug uuid=$pbd_uuid

xe sr-destroy uuid=$sr_uuid

new_sr_uuid=`xe sr-create content-type=”local SR” host-uuid=$inst_uuid type=ext device-config-device=$dev shared=false name-label=”Local File SR”`

pool_id=`xe pool-list | grep uuid | cut -d ‘:’ -f2 | cut -c 2-`

xe pool-param-set default-SR=$new_sr_uuid uuid=$pool_id

xe pool-param-set suspend-image-SR=$new_sr_uuid uuid=$pool_id

#echo $dev
#echo $sr_uuid
#echo $pbd_uuid
#echo $inst_uuid
#echo $new_sr_uuid
#echo $pool_id

Feel free to post a comment here if you have any feedback. Enjoy!