Changes

Jump to: navigation, search

stoney conductor: VM Backup

357 bytes removed, 13:26, 10 January 2014
/* How to manually restore a machine from backup */
</source>
and '''edit the file at the retain location''' according to your needs.-->
 
''' Now you are entering the critical part. You won't be able to undo the following steps'''
Check if there is a difference between the current LDAP entry and the one from the backup
and '''edit the file at the retain location''' according to your needs.
''' Now you If there are entering no differences (or the critical part. You won't be able to undo differences are not important) you can skip the following steps''' Undefine step. Otherwise use the machine<source lang='bash'>virsh undefine ${machinename}<[https://cloud.stepping-stone.ch/source> Remove phpldapadmin PhpLdapAdmin] to delete the machine entry <code>dn=sstVirtualMachine=${machinename},ou=virtual machines,ou=virtualization,ou=services,${ldapbase}</code> from the LDAP directroy<source lang='bash'>cat << EOF >> /tmp/remove_${machinename}.ldifdn: sstVirtualMachine=${machinename},ou=virtual machines,ou=virtualization,ou=services,${ldapbase}changetype: directory (do not forget to deleteEOFcat /tmp/remove_${machinename}.ldif</source>If everything looks OK, delete this the dhcp entry<source lang='bash'code>/usr/bin/ldapadd -H "ldaps://ldapmdn ..${domain}" -x -D "cn=Manager,${ldapbase}" -W -f /tmp/remove_${machinename}.ldif</sourcecodeAdd ). Then add the LDIF from the backup (which the one you might have modifiedjust edited) to the LDAP directroy
<source lang='bash'>
/usr/bin/ldapadd -H "ldaps://ldapm.${domain}" -x -D "cn=Manager,${ldapbase}" -W -f /var/virtualization/retain/${vmtype}/${vmpool}/${machinename}/${currentdate}/${machinename}.ldif.${backupdate}
</source>
Check Undefine the entry:machine
<source lang='bash'>
ldapsearch -H ldaps://ldapm.${domain} -b "sstVirtualMachine=virsh undefine ${machinename},ou=virtual machines,ou=virtualization,ou=services,${ldapbase}" -s sub -x -D "cn=Manager,${ldapbase}" -W "(objectclass=*)"
</source>
Now the machine should be up and running again. Continuing where it was stopped when taking the backup.
 
If everything is OK, you can cleanup the created files and directories
<source lang='bash'>
rm -rf /var/virtualization/retain/${vmtype}/${vmpool}/${machinename}/${currentdate}
rm /tmp/${machinename}.ldif
</source>
== Next steps ==
486
edits