This topic provides instructions to backup and restore a Kernel-based virtual machine (KVM) in RHEL Open Client.
Note: It is recommended that you shut down all running virtual machines in your system before beginning this process to ensure you have enough space available on your backup media.
**Backup a KVM
Restore a KVM
Restore the Desktop Shortcut**
1. Open a terminal. Click Computer, More Applications, then Terminal.
2.Use the sudo - command to become the root user.
[IBM User ~]$ sudo -s
[sudo] password for IBM User:
3.Change to the "/etc/libvirt/qemu" directory.
[root IBM User]# cd /etc/libvirt/qemu
[root qemu]#
4.Show all availabe KVM image configuration files. In the example below, three virtual machines are available.
[root qemu]# ls -l
total 40
drwx------. 3 root root 4096 May 29 11:21 networks
-rw-rw-r--. 1 root root 4622 Jun 4 07:44 Virtual_Client_for_Linux_Windows_7-2014-02-28-g-KVM.xml
-rw-rw-r--. 1 root root 4622 Jun 4 07:44 Virtual_Client_for_Linux_Windows_7-2014-03-27-w-KVM.xml
-rw-rw-r--. 1 root root 4596 Jun 4 07:44 Virtual_Client_for_Linux_Windows_7-KVM.xml
5.Copy the desired XML file from the above list to the back-up location. (The back-up location used in this example is "/home/IBM User," but you can use a different location.)
[root qemu]# cp Virtual_Client_for_Linux_Windows_7-KVM.xml /home/IBM User/
6.The corresponding image file is located in the directory "/var/lib/libvirt/images." Open the directory.
[root qemu]# cd /var/lib/libvirt/images/
[root images]#
7.Show all KVM image files. You should see the same names as above.
[root images]# ls -l
-rw-r--r--. 1 root root 32217432064 Feb 28 12:32 Virtual_Client_for_Linux_Windows_7-2014-02-28-g-KVM.qcow2
-rw-rw-r--. 1 root root 10 Feb 28 12:00 Virtual_Client_for_Linux_Windows_7-2014-02-28-g-KVM.qcow2.type
-rw-r--r--. 1 root root 32217432064 Mar 27 13:28 Virtual_Client_for_Linux_Windows_7-2014-03-27-w-KVM.qcow2
-rw-rw-r--. 1 root root 10 Mar 27 13:19 Virtual_Client_for_Linux_Windows_7-2014-03-27-w-KVM.qcow2.type
-rw-r--r--. 1 root root 32217432064 Mar 20 06:53 Virtual_Client_for_Linux_Windows_7-KVM.qcow2
-rw-rw-r--. 1 root root 10 Jan 22 07:04 Virtual_Client_for_Linux_Windows_7-KVM.qcow2.type
8.Copy the files corresponding to the XML file copied above to the back-up location.
[root images]# cp Virtual_Client_for_Linux_Windows_7-KVM.qcow2 /home/IBM User/
9.Switch back to your normal user by using the exit command.
[root images]# exit
exit
[IBM User ~]$
10.Change to the Desktop directory inside your home directory by using the cd ~/Desktop command.
[IBM User ~]$ cd ~/Desktop/
[IBM User Desktop]$
11.Finally, copy the desktop shortcut to the back-up location.
[IBM User Desktop]$ cp Virtual_Client_for_Linux_Windows_7-KVM-virt-manager.desktop /home/IBM User/
[IBM User Desktop]$
1. Open a terminal. Click Computer, More Applications, then Terminal.
2.Use the sudo -s command to become the root user.
[IBM User ~]$ sudo -s
[sudo] password for IBM User:
[root IBM User]#
3. Change to the back-up directory. (The backup location used in this example is "/home/IBM User" but you should enter your back-up location.)
[root IBM User]# cd /home/IBM User
4.Copy the XML file from the virtual machine to the "/etc/libvirt/qemu/" directory.
[root IBM User]# cp Virtual_Client_for_Linux_Windows_7-KVM.xml /etc/libvirt/qemu/
cp: overwrite `/etc/libvirt/qemu/Virtual_Client_for_Linux_Windows_7-KVM.xml'? y
[root IBM User]#
5.Copy the QCOW2 file back to the "/var/lib/libvirt/images" directory.
[root IBM User]# cp Virtual_Client_for_Linux_Windows_7-KVM.qcow2 /var/lib/libvirt/images/
cp: overwrite `/var/lib/libvirt/images/Virtual_Client_for_Linux_Windows_7-KVM.qcow2'? y
6.Switch back to your normal user by using the exit command.
[root Desktop]# exit
exit
[IBM User ~]$
7.Copy the desktop shortcut back to the "~/Desktop" directory.
[IBM User ~]$ cp Virtual_Client_for_Linux_Windows_7-KVM-virt-manager.desktop ~/Desktop/
8.Restart "libvirtd" to apply the configurations change.
[IBM User ~]$ sudo service libvirtd restart
[sudo] password for IBM User:
Stopping libvirtd daemon: [ OK ]
Starting libvirtd daemon: [ OK ]
Restore the Desktop Shortcut
If the desktop shortcut has been lost, it can be recreated using the following steps.
1.Click Computer, then More Applications.
2.On the left side, click System Tools, then IBM Virtual Machine Manager.
3.Select the virtual machine from the list and press the Launch button.
4.In the IBM Virt Viewer (the window with the virtual machine), select Actions, then click "Create Shortcut on Desktop."
如果觉得我的文章对您有用,请点赞。您的支持将鼓励我继续创作!
赞3
添加新评论1 条评论
2018-06-21 21:21