This article describes how to migrate a dedicated catalog to another datastore.
Customers using XenDesktop Machine Creation Service (MCS) with dedicated catalog and VMWare hypervisor may want to relocate the desktops to another datastore for various reasons such as datastore running out of space or datastore performance. This article outlines the process to move to another datastore.
Note: After completion, the machines will be of type ‘Existing’ and will still be power managed and controlled by XenDesktop, however XenDesktop will no longer have ownership of the machines in the respect that they cannot be cleaned up and deleted by XenDesktop anymore.
During the dedicated catalog creation process, the following occurs:
MCS creates a snapshot (thin) of the master VM unless you selected a snapshot, which will not create another snapshot. This uses minimal space.
MCS creates a full copy of the point in time snapshot and places this on each storage repository defined in the host connection. This will utilize the amount of space used for your complete image.
MCS adds these desktops into Active Directory. This step creates the unique AD identities to be used later in the process
MCS creates the number of VMs specified in the create catalog wizard with two disks defined for each VM. However, in addition to the two disks for each VM, a master will also be stored in the same storage repository. If you have multiple storage repositories defined, then each one will get the following types of disks:
All VDA belonging to the catalog and datastore will reference the copy created in Step 2 for most reads request. VMware refer to this configuration as ‘Linked Clones’. Backing up, cloning or moving will consolidate the full copy + diff disk in thick format which may not be desirable when several hundred VDAs are involved.
XenDesktop SDK (Installed by default on the Desktop Delivery Controller)
VMware Power Cli 5.x available from VMware.com
Complete the following steps to migrate a dedicated catalog to another datastore.
Note: Items in red should be changed to match environment configuration:Export list of VDAs and assigned users from XenDesktop. This is the reference file to validate that users will be assigned to their respective desktop.
Validate that there are no active sessions. Enable maintenance mode on the Desktop Group and shutdown the machines that are to be migrated. This will stop XenDesktop attempting to power control the machines during the migration.
XenDesktop PowerShell command to export user/assigned desktops:Get-BrokerDesktop -DesktopGroupName "contoso" -MaxRecordCount 1000 -DesktopKind Private | sort HostedMachineName | Select-Object -Property HostedMachineName,HypervisorConnectionName,LastConnectionUser |Export-Csv c:\output\contoso.csv
Connect to VMware host using the following command:
C:\PS> Connect-VIServer -Server vcenter01 -User admin -Password pass
Export list of VM with their diff disks name and type based on naming scheme through VMware PowerCli.
VMware PowerCli command:Get-vm contosow7*| get-harddisk | select Parent,StorageFormat,Filename | Export-Csv c:\output\contoso_disks.csv –NoTypeInformation
The output will list a diff and identity disk per VM. For the migration, only the diff disk is needed. The cvs file should be filtered and the rows containing the identity disk deleted.
Copy vmdk to new storage.
VMware PowerCli command:Copy-DatastoreItem 'vmstore:\vc-servername\source_datastore\ contosow7-baseDisk-datastore-11\*' 'vmstore:\vc-servername\dest_datastore\ contosow7-baseDisk-datastore-11\' -Force
After copy has been completed, base disk will be converted to thick format; diff disk will remain thin-provisioned.
Back up the base and diff disk folder defined in the filename column of the contoso_disk.csv file. Delete the machines to be migrated through the desktop studio console and choose the options to "Remove the accounts from the Catalog but do not remove them from Active Directory".
Create new machines with existing disks. (Import.csv) file is used with the columns shown in the following table.
VMName | LastConnectionUser | OldDiskPath | NewDiskPath |
contosow7AAA | contoso\user1 | [source_datastore] contosow7-baseDisk-datastore-11/contosow7-baseDisk-datastore-217-000005.vmdk | [dest_datastore] contosow7-baseDisk-datastore-11/contosow7-baseDisk-datastore-217-000005.vmdk |
Add machines to DDC as existing catalog using csv file with content similar to the following.
[VirtualMachinePath] | [ADComputerAccount] | [AssignedUsers] |
XDHyp:\connections\contoso_esx\vc_server.datacenter\my.cluster\Contosow7AAA.vm | Contoso\Contosow7AAA$ | contoso\User1 |
windows8(Windows 8.1)
windows8-64(Windows 8.1(64 bit)
windows8(Windows 8.0)
windows8-64(Windows 8.(64 bit)
windows7_64Guest (Windows 7 (64 bit)
windows7Guest (Windows 7)
windows7Server64Guest (Windows Server 2008 R2 (64 bit)
windows8srv-64(Windows Server 2012 R2 (64 bit)
winXPPro64Guest (Windows XP Professional Edition (64 bit)
winXPProGuest (Windows XP Professional)