Changes

Jump to: navigation, search

stoney conductor: VM Backup

854 bytes added, 09:06, 10 January 2014
/* How to manually restore a machine from backup */
currentdate=`date --utc +'%Y%m%dT%H%M%SZ'`
mkdir -p /var/virtualization/retain/vm-persistent/${vmpool}/${machinename}/${currentdate}
cp -p /var/backup/virtualization/vm-persistent/${vmpool}/${machinename}/${backupdate}/* /var/virtualization/retain/vm-persistent/${vmpool}/${machinename}/${currentdate}
</source>
 
Check if there is a difference between the current XML file and the one from the backup
<source lang='bash'>
diff -Naur /etc/libvirt/qemu/${machinename}.xml /var/virtualization/retain/vm-persistent/${vmpool}/${machinename}/${currentdate}/${machinename}.xml.${backupdate}
</source>
and edit the file at the retain location according to your needs.
 
Check if there is a difference between the current LDAP entry and the one from the backup
<source lang='bash'>
domain="<DOMAIN>" # For example domain="stoney-cloud.org"
ldapsearch -H ldaps://ldapm.${domain} -b "sstVirtualMachine=${machinename},ou=virtual machines,ou=virtualization,ou=services,dc=stoney-cloud,dc=org" -s sub -x -D "cn=Manager,dc=stoney-cloud,dc=org" -W "(objectclass=*)" > /tmp/${machinename}.ldif
</source>
''' Now you are entering the critical part. You won't be able to undo the following steps'''
486
edits