In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Editor to share with you the method of backing up virtual machines in XenServer. I hope you will gain a lot after reading this article. Let's discuss it together.
Method 1: back up the running virtual machine manually
The following steps can also be performed through XenCenter, but Linux users prefer to use the command line.
1. Find VMS UUID
Use the following command to get a list of UUID and other details for all vms. This UUID will be used in the next step
# xe vm-list is-control-domain=false is-a-snapshot=false
Output
Uuid (RO): 8ac95696 94f3-83c1-bc89-8bb2603f832b name-label (RW): test-vm power-state (RO): running
According to the output test above, vm uuid is "8ac95696-94f3-83c1-bc89-8bb2603f832b". You may be in other situations.
2. Create a VMS snapshot
Now use the following command to create a VM snapshot using the UUID found in the previous steps. Make sure you use the correct UUID.
# xe vm-snapshot uuid=8ac95696-94f3-83c1-bc89-8bb2603f832b new-name-label=testvmsnapshot
The above command retrieves the uuid of the snapshot and uses this uuid to convert the snapshot to vm, so we can export it to a file using the following command.
# xe template-param-set is-a-template=false ha-always-run=false uuid=b15c0531-88a5-98a4-e484-01bc89131561
3. Export the snapshot to a file
Now we can export the created snapshot to an .xva file, which can be easily restored from the command line or Xencenter.
# xe vm-export vm=b15c0531-88a5-98a4-e484-01bc89131561 filename=vm-backup.xva
4. Destroy the snapshot
Finally, because we have backed up to the XVA file, we can destroy the snapshot we created from XenServer.
# xe vm-uninstall uuid=b15c0531-88a5-98a4-e484-01bc89131561 force=true
Method 2: run vms using script backup
To back up all virtual machines running on XenServer, we can also use the following shell script. This script installs a remote file system exported through NFS. This script is perfect for this example, but it may not apply to you. So using this script doesn't guarantee your viability.
#! / bin/bash## Written By: Mr Rahul Kumar# Created date: Jun 14, 2014# Last Updated: Mar 08 2018 Version: 1.2.Mounting remote nfs share backup drive Visit: https://tecadmin.net/backup-running-virtual-machine-in-xenserver/#DATE=`date +% d% b% Y`XSNAME = `echo $HOSTNAME`UUIDFILE = / tmp/xen-uuids.txtNFS_SERVER_IP= "192.168.10.100" MOUNTPOINT=/xenmntFILE_LOCATION_ON_NFS= "/ backup/citrix/vms" # Create mount pointmkdir-p ${MOUNTPOINT} # # Mounting remote nfs share backup drive [!-d ${MOUNTPOINT}] & echo "No mount point found, kindly check" Exit 0mount-F nfs ${NFS_SERVER_IP}: ${FILE_LOCATION_ON_NFS} ${MOUNTPOINT} BACKUPPATH=$ {MOUNTPOINT} / ${XSNAME} / ${DATE} mkdir-p ${BACKUPPATH} [!-d ${BACKUPPATH}] & echo "No backup directory found" Exit echo Fetching list UUIDs of all VMs running on XenServerxe vm-list is-control-domain=false is-a-snapshot=false | grep uuid | cut-d ":"-f2 > ${UUIDFILE} [!-f ${UUIDFILE}] & & echo "No UUID list file found" Exit 0while read VMUUIDdo VMNAME= `xe vm-list uuid=$VMUUID | grep name-label | cut-d ":"-f2 | sed's / ^ * / / g``SNAPUUID= `xe vm-snapshot uuid=$VMUUID new-name-label= "SNAPSHOT-$VMUUID-$DATE" `xe template-param-set is-a-template=false ha-always-run=false uuid=$ {SNAPUUID} xe vm-export vm=$ {SNAPUUID} filename= "$BACKUPPATH/$VMNAME-$DATE.xva" xe vm-uninstall uuid=$ {SNAPUUID} force=truedone < ${UUIDFILE} umount ${MOUNTPOINT} I believe you have a certain understanding of the method of backing up virtual machines in XenServer. If you want to know more about it, welcome to follow the industry information channel. Thank you for your reading!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.