Changes

Jump to: navigation, search

stoney conductor: VM Backup

358 bytes added, 12:44, 22 October 2013
/* Snapshot */
#* Save the state of VM <code>vm-001</code> to the file <code>vm-001.state</code>: <syntaxhighlight lang="bash">virsh save vm-001 vm-001.stat</syntaxhighlight>
#* After this command, the VMs CPU and memory state is represented by the file <code>vm-001.state</code> and the VM <code>vm-001</code> is shut down.
#* Move the disk image <code>/path/to/images/vm-001.qcow2</code> to the retain location: <syntaxhighlight lang="bash">mv /path/to/images/vm-001.qcow2 /path/to/retain/vm-001.qcow2</syntaxhighlight>#** '''Please note:''' The retain directory (<code>/path/to/retain/</code>) '''has to be''' on the same partition as the images directory (<code>/path/to/images/</code>). This will make the <code>mv</code> operation very fast (only renaming the inode). So the downtime (remember the VM <code>vm-001</code> is shut down) is as short as possible.#* Create the new disk image with the old as backing file: <code>qemu-img create -f qcow2 -b my-vm-backup.qcow2 my-vm.qcow2</code>.
#* Set correct ownership and permission to the newly created image:
#** <code>chown root:vm-storage my-vm.qcow2</code>.
486
edits