2.4-Virtual Disk recovery virtual machine

Source: Internet
Author: User

If you want to completely delete a virtual machine, you need 3 commands

1.virsh Destroy Wyp1 #首先从列表中删除

2.virsh undefine wyp1 #删除虚拟机的配置文件.

3.rm-rf/data/wyp1.img #最后删除虚拟机的文件


If you want to restore the virtual machine wyp1 at this time, you must have an img file , or first copy the wyp2.img file for wyp1.img in a copy of a virtual machine configuration file.


1.cp/data/wyp2.img/data/wyp1.img #复制一份磁盘文件

2.Cp/etc/libvirt/qemu/wyp2.xml/etc/libvirt/qemu/wyp1.xml

or use the command virsh dumpxml wyp2 >/etc/libvirt/qemu/wyp1.xml #备份重定向到wyp1. xml

3.vim/etc/libvirt/qemu/wyp1.xml #主要修改虚拟机name and uuid(Prevent and WYP2 conflicts), modify the type= ' in Disk type Raw' source file= '/data/wyp1.img' disk format and path modified to WYP1 path. There are 4 different places to change, others to keep the default.

4.Virsh define/etc/libvirt/qemu/wyp1.xml #定义虚拟机配置文件


Virtual machine recovery is complete.


2.4-Virtual Disk recovery virtual machine

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.