On the XenServer host
•Schedule a regular metadata backup to the default pool SR, either daily, weekly or monthly. This will regularly rotate metadata backups and ensure that the latest metadata is present for that SR without any user intervention being required.
•Trigger an immediate metadata backup to the SR of your choice. This will create a backup VDI if necessary, and attach it to the host and backup all the metadata to that SR. Use this option if you have made some changes which you want to see reflected in the backup immediately.
•Perform a metadata restoration operation. This will prompt you to choose an SR to restore from, and then the option of restoring only VM records associated with that SR, or all the VM records found (potentially from other SRs which were present at the time of the backup). There is also a dry run option to see which VMs would be imported, but not actually perform the operation.
For automating this scripting, there are some commands in the control domain which provide an interface to metadata backup and restore at a lower level than the menu options:
•
•
Full usage information for both scripts can be obtained by running them in the control domain using the
Moving SRs between hosts and Pools
The metadata backup and restore options can be run as scripts in the control domain or through the Backup, Restore, and Update menu option in the xsconsole. All other actions, such as detaching the SR from the source host and attaching it to the destination host, can be performed using XenCenter, the
To create and move a portable SR using the xsconsole and XenCenter
1.On the source host or pool, in xsconsole, select the Backup, Restore, and Update menu option, select the Backup Virtual Machine Metadata option, and then select the desired SR.
2.In XenCenter, select the source host or pool and shutdown all running VMs with VDIs on the SR to be moved.
3.In the tree view select the SR to be moved and select Storage > Detach Storage Repository. The Detach Storage Repository menu option will not be displayed if there are running VMs with VDIs on the selected SR. After being detached the SR will be displayed in a
Warning:
Do not complete this step unless you have created a backup VDI in step 1.
4.Select Storage > Forget Storage Repository to remove the SR record from the host or pool.
5.Select the destination host in the tree view and select Storage > New Storage Repository.
6.Create a new SR with the appropriate parameters required to reconnect the existing SR to the destination host. In the case of moving a SR between pools or hosts within a site the parameters may be identical to the source pool.
125