Xenserver command to export and import vm nodes

Source: Internet
Author: User
Tags uuid centos

There is a Xenserver node in the data center. The RAID 5 made of six disks has an alarm today. It is estimated that the disk data is inconsistent. At that time, I forgot to prepare a hot spare disk. So before restarting, back up the node and restart it to verify the disk.
First, check which nodes are available.

[Root @ xenserver-DS-TestServer04 mnt] # xe vm-list
Uuid (RO): 0555a7e5-eba4-aaae-2caf-bbb4b53724aa
Name-label (RW): CentOS 7.2x64 Node (10.10.10.250)
Power-state (RO): halted
 
 
Uuid (RO): 62482630-89f1-4ebf-ada8-aecbc633f4e9
Name-label (RW): Control domain on host: xenserver-DS-TestServer04
Power-state (RO): running
 
 
Uuid (RO): ee6aaf82-5771-59b7-9256-db5729099b45
Name-label (RW): CentOS 7.2x64 Node (MariaDB-Galera_Node01) 10.10.231.130
Power-state (RO): running
 
 
[Root @ xenserver-DS-TestServer04 mnt] #

If the node is running, we need to stop it before exporting.

[Root @ xenserver-DS-TestServer04 mnt] # xe vm-shutdown uuid = ee6aaf82-5771-59b7-9256-db5729099b45 force = true
# Or use the command xe vm-shutdown vm = 'centos 7.2x64 Node (MariaDB-Galera_Node01) 10.10.231.130 'force = true

Then start exporting

[Root @ xenserver-DS-TestServer04 mnt] # xe vm-export uuid = ee6aaf82-5771-59b7-9256-db5729099b45 filename =/mnt/'centos 7.2x64 Node (MariaDB-Galera_Node01) 10.10.231.130.xva'
Export succeeded
[Root @ xenserver-DS-TestServer04 mnt] # xe vm-export uuid = 0555a7e5-eba4-aaae-2caf-bbb4b53724aa filename =/mnt/'centos 7.2x64 Node (10.10.10.250). xva'
Export succeeded
[Root @ xenserver-DS-TestServer04 mnt] #

Finally, import


[Root @ xenserver-DS-TestServer04 mnt] # xe vm-import filename =/mnt/'centos 7.2x64 Node (10.10.10.250). xva'

Batch import


[Root @ xenserver-DS-TestServer04 mnt] # ls | awk '/xva/' | sed's // \/g; s/(// \ (/g; s /) /\)/'| xargs-I xe vm-import filename = {}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.