Change root password XenServer pool

I have just finished creating a PowerShell script that changes the local root password for a Citrix XenServer pool.

You will find a ZIP file containing the script here: http://muya.no-ip.info/wordpress/wp-content/uploads/2011/09/Change-root-Password-XenServer.zip

 

Script:

function Get-EncryptedText($text) {

$Ptr = [System.Runtime.InteropServices.Marshal]::SecureStringToCoTaskMemUnicode($text)

$result = [System.Runtime.InteropServices.Marshal]::PtrToStringUni($Ptr)

[System.Runtime.InteropServices.Marshal]::ZeroFreeCoTaskMemUnicode($Ptr)

$result

}

Try {

Get-PSSnapin XenServerPSSnapin -ErrorAction Stop

}

Catch [Exception] {

If ($env:PROCESSOR_ARCHITECTURE -eq “AMD64”) {Invoke-Expression “$env:systemroot\Microsoft.NET\Framework64\v2.0.50727\InstallUtil.exe ‘c:\Program Files (x86)\Citrix\XenServerPSSnapIn\XenServerPSSnapIn.dll'”; Add-PSSnapin XenServerPSSnapin}

If ($env:PROCESSOR_ARCHITECUTRE -eq “x86”){Invoke-Expression “$env:systemroot\Microsoft.NET\Framework\v2.0.50727\InstallUtil.exe ‘c:\Program Files\Citrix\XenServerPSSnapIn\XenServerPSSnapIn.dll'”; Add-PSSnapin XenServerPSSnapin}

}

 

$PoolMaster = Read-Host ‘Enter Poolmaster’

$Username = Read-Host ‘Enter Username’

$Password = Read-Host -AsSecureString ‘Enter Old Password’

$NewPassword = Read-Host -AsSecureString ‘Enter New Password’

$NewPasswordPlain = Get-EncryptedText $NewPassword$

PasswordPlain = Get-EncryptedText $Password

 

# // Build connection to xenserver

 

Try {

$Connect = [XenAPI.Session] ($(“https://” + $PoolMaster))

$Connect = Connect-XenServer -Server $PoolMaster -UserName $Username -Password $PasswordPlain -NoWarnCertificates

}

 

Catch [XenAPI.Failure] {

$Connect = Connect-XenServer -Server ($($_.exception.ErrorDescription[1])) -UserName $Username -Password $Password -NoWarnCertificates

}

 

# // Change Password

$Connect.change_password($PasswordPlain, $NewPasswordPlain)

XenServer 6.0 Beta available

Last week Citrix released XenServer 6.0 Beta.

Below is an overview of what’s included in the XenServer 6.0 Beta.

Product simplification.

  • XenServer has simplified the management infrastructure requirements for features such as Workload Balancing, StorageLink, and Site Recovery.  In fact, for StorageLink and Site Recovery, no additional management infrastructure is required at all.
  • Workload Balancing (and its Historical Reporting features) is available as a Linux-based virtual appliance for easy installation and management.
  • The Linux supplemental pack has been removed, so there is only 1 base installation CD. ”Linux demo VM” functionality has been moved to a virtual appliance format so it can be easily imported into a host or resource pool.

Architectural Changes

  • The XenServer 6.0 release is based on the Xen 4.1 hypervisor
  • The Open vSwitch (OVS) is now the default network stack for the product.   OVS was first introduced in XS 5.6 FP1 as a post-install configuration option, and is the basis for the distributed virtual networking (DVS) features, NIC bonding improvements, and  jumbo frames support .  Improvements to DVS include improved availability through the “fail-safe” option, as well various improvements based on customer feedback from XenServer 5.6 FP1. Note that the legacy Linux bridging stack is still available via a post-install configuration option
  • General network performance has been improved, particularly aggregate host network throughput; internal measures vs. prior XS releases show gains of 70-100% in some instances
  • Support for hardware-assisted (SR-IOV) network performance optimizations has been improved, particularly for use with the NetScaler VPX and SDX products

Tools for Self-Service and building Clouds

  • The new Self Service Manager feature enables you to build self-service environments for “private clouds.”  Self-Service Manager includes support for both XenServer as well as VMware vSphere
  • Self-Service Manager is easy to deploy and manage via a simple virtual appliance and web-based UI.  It offers multi-tenant support for creating VM “service catalogs” used by delegated administrators to deploy and manage their own applications and resources
  • Virtual Appliance support.  Within XenCenter 6.0 you can create multi-VM virtual appliances (vApps), with relationships between the VMs for use with the boot sequence during Site Recovery.  vApps can be easily imported and exported using the Open Virtualization Format (OVF) standard
  • VMDK and VHD import functionality is integrated into XenCenter for interoperability with VMware VMDK and Microsoft VHD disk images. Reliability of the “transfer VM” used for appliance import/export has been improved

Microsoft System Center integration

  • Starting with the XS 6.0 release, you will have the option of managing XenServer hosts and VMs with System Center Virtual Machine Manager (VMM) 2012.  For more information refer to the Microsoft System Center 2012 beta page
  • System Center Operations Manager 2012 will be able to manage and monitor XenServer hosts and virtual machines
  • System Center integration is available with a special supplemental pack from Citrix, which is targeted for general availability when System Center 2012 ships later this year.

XenDesktop

  • 6.0 is the first XenServer release to include HDX enhancements for optimized user experience with virtual desktops
  • With the 6.0 release, a physical GPU can be assigned to a VM so the applications running in the guest can leverage GPU instructions (“GPU pass-thru”).  This provides significant TCO benefits for the XenDesktop HDX 3D Pro technology used for delivery of CAD and other graphical applications via virtual desktops

Guest OS support updates

  • Formal guest support for Ubuntu 10.04
  • Updates for support of RHEL 5.6, CentOS 5.6, and SLES 10 SP4
  • Experimental VM templates for Ubuntu 10.10 and Solaris
  • Note also that RHEL 6.0 is fully supported (also supported with XS 5.6 SP2)

Other enhancements and improvements

  • A “rolling pool upgrade” wizard is provided in XenCenter to enable more reliable upgrades from 5.6 and 5.6 FP1 to 6.0.
  • High Availability (HA) permits configuration of a boot sequence for recovery, as well as storage of the heartbeat disk via NFS
  • Host RAM support has been increased to 1 TB
  • VM vCPU and vRAM support is increased e.g. up to 16 vCPUs and 128 GB RAM for Windows; increased Linux vCPU and vRAM support levels vary by distro
  • NIC bonding reliability is improved, and formal support for active/passive bonding has been added
  • XenCenter will be localized into Japanese and Simplified Chinese (these will be generally available a few months following the English release)

Noteworthy changes to existing features

  • Lab Manager has been superseded by Self Service Manager.  Lab Manager will continue to be supported with XenServer 5.x through December 2012 according to the lifecycle policy posted here
  • StorageLink: With the move from the Windows-based “StorageLink Gateway” to “integrated StorageLink,” some StorageLink array support is being retired.  Focus for StorageLink support is being placed on arrays with standards-based SMI-S interfaces (e.g. EMC CLARiiON) and those which are widely used with XenServer (NetApp and Dell EqualLogic).  Arrays whose StorageLink supportability is being retired will continue to be supported via the standard iSCSI and Hardware HBA Storage Repositories.  StorageLink Gateway will continue to be supported with XenServer 5.x until September 2013 according to the lifecycle policy posted here.   Note also that the new “rolling pool” upgrade takes care of upgrading from StorageLink Gateway, and performing validation for unsupported arrays
  • Site Recovery:  Site Recovery is no longer based on StorageLink.  This enables DR support for virtually any iSCSI or Hardware HBA storage repository scenario where the underlying array includes replication features (either supplied by the array vendor or a third-party replication scenario)

XenServer Self-Signed Certificate

I recently ran into an issue where I had to take a XenServer from a development environment and run it into a production environment. Since time was of the essence, I had not created a freshly installed XenServer host, but just changed the IP addresses.

So, when I tried connecting to the server over https, it said that the certificate wasn’t correct anymore. It seems the self-signed certificate is created based on the IP address of the XenServer host.
Below you find the procedure to recreate a new certificate based on the new ip address.
Login as a root user:
1. cd /tmp
2. openssl req -x509 -nodes -days 3650 -subj ‘/C=NL/ST=N-Holland/L=Amsterdam/CN=(NEW_IP_ADDRESS)’ -newkey rsa:1024 -keyout certificate.pem -out certificate.pem
3. cd /etc/xensource/
4. mv xapi-ssl.pem xapi-ssl.pem_orig
5. cp /tmp/certificate.pem ./xapi-ssl.pem
6. chmod 0400 /etc/xensource/xapi-ssl.pem
7. /etc/init.d/xapissl restart
That should do the trick… It created a self-signed certificate that lasts for 10 years.

XenDesktop 5 Maintenance Script

I’ve just finished creating a XenDesktop 5 Maintenance Script in PowerShell. Currently running tests to run the script on the Controllers through SCCM.

What the script does (in a nutshell):

  1. Connect to XenServer
  2. Start the VM
  3. Update the virus definition files
  4. Update the App-V cache
  5. Shutdown the VM
  6. Make a new snapshot
  7. Update the VDI’s to use the new snapshot.

Let’s wait and see….