Skip to content

How to Backup VMs Metadata in Citrix Xenserver

How to Backup VMs Metadata in Citrix Xenserver. This article describes how to backup metadata for an individual Virtual Machines on Citrix Xen Servers.

On this page

This article describes how to back up metadata for an individual Virtual Machines on Citrix Xen Servers. In this article, you will get step by step instructions for backing up metadata. Also at end of this article, there is a small shell script which can be used for backup metadata for all VMs running on the Xen server.

citrix-image

1. Backup VMs Metadata in Citrix Xenserver

1.1. Find VMs UUID

Use the following command to get list of UUIDs of all vms along with other details. this UUID will be used in next steps.

xe vm-list is-control-domain=false is-a-snapshot=false
uuid ( RO)           : 8ac95696-94f3-83c1-bc89-8bb2603f832b
     name-label ( RW): test-vm
    power-state ( RO): running

As per above output test-vm uuid is “8ac95696-94f3-83c1-bc89-8bb2603f832b“.

1.2. Backup Metadata using UUID

After getting UUID of vm, use following command to backup metadata of virtual machine with uuid 8ac95696-94f3-83c1-bc89-8bb2603f832b and create metadata backup file metadata.bak.

xe vm-export filename=metadata.bak uuid=8ac95696-94f3-83c1-bc89-8bb2603f832b metadata=true

You have completed vm metadata backup successfully.

2. Script for Backup All VMs Metadata

This is a good option to schedule metadata backup regularly. You can schedule the below script for backup all the vms metadata on Xen server.

How to use script:

2.1 – Copy this script to a file /scripts/metadata-backup.sh in xenserver.

2.2 – This script is using a remote backup server mounted using nfs, You can replace this with your own settings.

2.3 – Execute this script using sh /scripts/metadata-backup.sh.

2.4 – For regular backup schedule this in systems crontab. [Crontab Examples]

Rahul

Rahul Kumar is the founder and chief editor of TecAdmin.net. A Red Hat Certified Engineer (RHCE), he has worked in IT since 2009, with hands-on experience in Linux system administration, DevOps, web hosting, cloud platforms and automation. He started TecAdmin in 2013 to share practical, step-by-step guides, and leads its editorial work with one aim: making technical learning clear and useful for sysadmins, developers and beginners alike.

Leave a Reply

Your email address will not be published. Required fields are marked *


Back to top