Citrix have an detailed article on Managing Personal Vdisks and backing up and restoring them.
This is detailed in the E-docs here
The following shows the process used by RealServe IT in our labs to test the process.
This process is designed to help move a users Personal Vdisk to another catalog.
This could be used to migrate users to a newer environment or recover from a failure.
Essentialy the scripts attach the users personal Vdisk to another Virtual Machine.
The document says the personal Vdisk can only be moved however to a catalog with a master related to the original catalog the Vdisk started life from. This could limit the flexibilty of this process.
Vmware Powershell CLI
Download the Vmware PowerCLI tools. (eg. Vmware-PowerCLI-5.1.0-793510)
I installed this onto my DDC where i am going to run the scripts.
I grabbed the Citrix scripts from the Xendesktop source media.
When running the script I received a certificate error for Vcenter. Im not sure why as my VSphere client works as expected from the same box.
I found a workaround is to ignore cert errors. To set this run the following powershell commands
Set-PowerCLIConfiguration -invalidcertificateaction ignore
From the DDC with the Vmware PowerCLI installed i ran the migration-backup.ps1 script.
VM not Assigned
When running the migration-backup.ps1 script I was getting an error VMs not assigned. This was correct, some of my VMs were not directly assigned to a user yet. This is just a warning.
Restore (Option 1)
1.)Create a new catalog from the same master as the original catalog.
2.)Assign the new catalog to the same delivery group
3.)Put the delivery group into maintenance mode and shut-down machines
4.)Move the Personal Vdisks as required to new storage (xxx_pvdisk.vmdk)
5.)Edit the XML file changing “diskname” to the new storage location
6.)Run migration-restore.ps1 , choose new Catalog, Choose storage, Choose XML file
7.)Remove maintenance mode
(Note : I received an error about maintenance mode, however the process worked)
(Note : The original Catalog with PVDisks remain and can be deleted once we are happy the process has worked)
(Note : to use powershell to check no-one is assigned to the machines use the following code
(Note : If you clean up the XML to remove unrequired machines, you need to ensure you keep the DUMMY section at the bottom or the script simply exits at the end.)
get-brokerdesktop -machinename domain\machinename
(Note: to manually connect to vmware and add the disk
connect-viserver server servername
new-harddisk -vm xxxx -diskpath “[storage name] folder/xxxx_pvdisk.vmdk”)
Script Change for Vmware Datastore Issue
I had a problem with the restore script running at a customer site. The error log file said the store name was “null” I correct this by amending the script slightly.
I amended the add-harddisk command to use the [$SRname] and $Diskname and this proved to work.
(Note there is a space required between SRname and Diskname)
Other handy VMWare CLI commands
get-datastore -vmhost hostname (this gets a list of the datastore names attatched to that host)
get-harddisk -vm “vmname” (gets list of harddisk for that VM)
In the case of failure to connect to vmware the proxy connection may need to be disabled.
Set-PowerCLIConfiguration -ProxyPolicy NoProxy -Confirm