Changes

Jump to: navigation, search

stoney conductor: VM Backup

1,537 bytes added, 08:24, 29 October 2013
/* Restore a machine */
* Non-User-Interaction phase: The daemons communicate through the backend between each other and the restore process continues without further user input (c.f. [[#Communication_through_backend_2 | Communication through backend]])
=== Restore a machine Sub Processes ===Shutdown ==== Unretain small files ====This workflow assumes that the VM if it backup directory is running: virsh shutdown my-vm Undefine on the VM if it same physical server as the retain directory (protocol is still definedfile: virsh undefine my//)# Copy the backend-vm Remove entry file from the VMs disk imagebackup directory to the retain directory: rm #* <source lang="bash">cp -p /path/to/backup/vm-001.backend /path/to/retain/vm-001.backend</source># Copy theXML description from the from the backup directory to the retain directory:#* <source lang="bash">cp -p /diskpath/imageto/mybackup/vm-001.xml /path/to/retain/vm-001.qcow2 Restore xml</source># Compare the VMs LDAP backend-entry: Merge file (the actual LDAP entry and one in the LDAP backup retain directory) with the live-backend entry On conflict ask #* Resolve all conflicts between these two backend entries#** Modify the user which backend entry wins Restore at the VMs XML Merge retain location accordingly# Apply the same changes for the actual XML-file and description at the backed up retain location (backend entry and XML-file On conflict ask description need to be consistent). ==== Unretain large files ====# Copy the user which state file wins from the backup directory to the retain directory:#* <source lang="bash">cp -p /path/to/backup/vm-001.state /path/to/retain/vm-001.state</source># Copy the disk image (s) from the backup directory to the live retain directory: #* <source lang="bash">cp -p /path/to/my-vm/backup/my-vm-001.qcow2.backup /path/to/theretain/vm-001.qcow2</source>#** '''Important:''' If a VM has more than just one diskimage, repeat this step for every disk image ==== Restore the VM ====# Shutdown the VM if it is running:#* <source lang="bash">virsh shutdown vm-001</source># Undefine the VM if it is still defined: #* <source lang="bash">virsh undefine vm-001</source># Overwrite the original disk image:#* <source lang="bash">mv /mypath/to/retain/vm-001.qcow2 /path/to/images/vm-001.qcow2 Define the </code>#** '''Important:''' If a VM has more than just one disk image, repeat this step for every disk image# Restore the VMs backend entry: #* Write the backend entry from the retain location (<code>/path/to/retain/vm-001.backend</code>) to the backend# Overwrite the VMs XML virsh define description with the one from the retain location #* <source lang="bash">cp -p /path/to/myretain/vm-001.xml /path/to/xmls/vm-001.xml </source># Restore the VM from the state file with the corrected XML#* <source lang="bash">virsh restore /path/to/my-retain/vm-001.state --xml /backuppath/to/xmls/my-vm-001.statexml</code>
== Communication through backend ==
486
edits