How to Migrate Dedicated Catalog to Another Datastore

How to Migrate Dedicated Catalog to Another Datastore

book

Article ID: CTX200434

calendar_today

Updated On:

Description

This article describes how to migrate a dedicated catalog to another datastore.

Background

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:

  1. MCS creates a snapshot (thin) of the master VM unless you selected a snapshot, which will not create another snapshot. This uses minimal space.

  2. 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.

  3. MCS adds these desktops into Active Directory. This step creates the unique AD identities to be used later in the process

  4. 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:

    • The full snapshot, which is read-only and shared across the VMs just created. Each storage repository will get one. This is the same disk identified in step 2 of the catalog creation process.
    • A unique identity disk (16MB) used to provide each VM with a unique identity. Functionality within the XenDesktop Controllers creates the identity disks. Each VM gets an identity disk.
    • A unique difference disk used to store any writes made to the VM. The disk is thin provisioned (if supported by the storage) and will increase to the maximum size of the base VM if required. Each VM gets a difference disk.

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.

Requirements

  • XenDesktop SDK (Installed by default on the Desktop Delivery Controller)

  • VMware Power Cli 5.x available from VMware.com


Instructions

Complete the following steps to migrate a dedicated catalog to another datastore.

Note: Items in red should be changed to match environment configuration:
  1. 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.

  2. 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
  3. Connect to VMware host using the following command:
    C:\PS> Connect-VIServer -Server vcenter01 -User admin -Password pass

  4. 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.

  5. 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.

  6. 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".

  7. Create new machines with existing disks. (Import.csv) file is used with the columns shown in the following table.

    VMNameLastConnectionUserOldDiskPathNewDiskPath
    contosow7AAAcontoso\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
    VMware PowerCli command:
    Import-Csv importcsv.csv -UseCulture | %{
    $vm = New-VM -Name $_.VMName -VMHost 20.10.102.12 -MemoryMB 2048 -NumCpu 2 -GuestId "windows7_64Guest" -NetworkName "VLAN 123"  -Datastore “Dest_Datastore” -DiskPath $_.NewDiskPath
    }
  8. 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.vmContoso\Contosow7AAA$contoso\User1

Valid Guest ID for VMware 4.0 and Later

  • 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)

Issue/Introduction

This article describes how to migrate a dedicated catalog to another datastore.