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 = {}