Changes

Jump to: navigation, search

stoney conductor: VM Backup

9,851 bytes added, 12:51, 23 October 2013
/* Communication through backend */
== Communication through backend ==
The actual KVM-Restore process is controlled completely by the Control instance daemon via the OpenLDAP directory. See [[#OpenLDAP Directory Integration|OpenLDAP Directory Integration]] the involved attributes and possible values.
 
[[File:Daemon-interaction-restore.jpeg]]
 
You can modify/update these interactions by editing [[File:Restore-Interaction.xml]] (you may need [http://uml.sourceforge.net/ Umbrello UML Modeller] diagram programme for KDE to display the content properly).
 
http://osbd.stepping-stone.ch/wiki/KVM-Restore
 
=== Control instance Daemon Interaction for restoring a Backup with LDIF Examples ===
==== Step 01: Start the unretainSmallFiles process (Control instance daemon) ====
The first step of the restore process is to copy the small files (in this case the XML file and the LDIF) from the configured backup location to the configured retain location.
 
<pre>
# The attribute sstProvisioningState is set to zero by the Control instance daemon, when sstProvisioningMode is modified to
# unretainSmallFiles (this way the Provisioning-Backup-VKM daemon knows, that it must start the unretainSmallFiles process).
dn: ou=20121002T010000Z,ou=backup,sstVirtualMachine=kvm-005,ou=virtual machines,ou=virtualization,ou=services,o=stepping-stone,c=ch
changetype: modify
replace: sstProvisioningState
sstProvisioningState: 0
-
replace: sstProvisioningMode
sstProvisioningMode: unretainSmallFiles
</pre>
 
==== Step 02: Starting the unretainSmallFiles process (Provisioning-Backup-KVM daemon) ====
As soon as the Provisioning-Backup-KVM daemon receives the command to unretain the small files, it sets the '''sstProvisioningMode''' to '''unretainingSmallFiles''' to tell the Control instance daemon and other interested parties, that it is unretaining the small files for the virtual machine or virtual machine template.
<pre>
# The attribute sstProvisioningMode is set to unretainingSmallFiles by the Provisioning-Backup-VKM daemon.
dn: ou=20121002T010000Z,ou=backup,sstVirtualMachine=kvm-005,ou=virtual machines,ou=virtualization,ou=services,o=stepping-stone,c=ch
changetype: modify
replace: sstProvisioningMode
sstProvisioningMode: unretainingSmallFiles
</pre>
 
==== Step 03: Finalizing the unretainSmallFiles process (Provisioning-Backup-KVM daemon) ====
As soon as the Provisioning-Backup-KVM daemon has executed the commands to unretain the small files, it sets the '''sstProvisioningMode''' to '''unretainedSmallFiles''', the '''sstProvisioningState''' to the current timestamp (UTC) and '''sstProvisioningReturnValue''' to zero to tell the Control instance daemon and other interested parties, that the unretaining of all the small files from the configured backup location is finished.
<pre>
# The attribute sstProvisioningState is set with the current timestamp by the Provisioning-Backup-VKM daemon, when
# the attributes sstProvisioningReturnValue and sstProvisioningMode are set.
# With this combination, the Control instance daemon knows, that it can proceed.
dn: ou=20121002T010000Z,ou=backup,sstVirtualMachine=kvm-005,ou=virtual machines,ou=virtualization,ou=services,o=stepping-stone,c=ch
changetype: modify
replace: sstProvisioningState
sstProvisioningState: 20121002T012000Z
-
replace: sstProvisioningReturnValue
sstProvisioningReturnValue: 0
-
replace: sstProvisioningMode
sstProvisioningMode: unretainedSmallFiles
</pre>
 
==== Step 04: Start the unretainLargeFiles process (Control instance daemon) ====
Next step in the restore process is to copy the large files (state file and disk images) from the configured backup directory to the configured retain directory.
 
<pre>
# The attribute sstProvisioningState is set to zero by the Control instance daemon, when sstProvisioningMode is modified to
# unretainLargeFiles (this way the Provisioning-Backup-VKM daemon knows, that it must start the unretainLargeFiles process).
dn: ou=20121002T010000Z,ou=backup,sstVirtualMachine=kvm-005,ou=virtual machines,ou=virtualization,ou=services,o=stepping-stone,c=ch
changetype: modify
replace: sstProvisioningState
sstProvisioningState: 0
-
replace: sstProvisioningMode
sstProvisioningMode: unretainLargeFiles
</pre>
 
==== Step 05: Starting the unretainLargeFiles process (Provisioning-Backup-KVM daemon) ====
As soon as the Provisioning-Backup-KVM daemon receives the command to unretain the large files, it sets the '''sstProvisioningMode''' to '''unretainingLargeFiles''' to tell the Control instance daemon and other interested parties, that it is unretaining the large files for the virtual machine or virtual machine template.
 
In the meantime the vm-manager merges the LDIF we have unretained in [[#Step_02:_Starting_the_unretainSmallFiles_process_.28Provisioning-Backup-KVM_daemon.29 | step 02]] with the one in the live directory to sort out possible differences in the configuration of the virtual machine.
<pre>
# The attribute sstProvisioningMode is set to unretainingSmallFiles by the Provisioning-Backup-VKM daemon.
dn: ou=20121002T010000Z,ou=backup,sstVirtualMachine=kvm-005,ou=virtual machines,ou=virtualization,ou=services,o=stepping-stone,c=ch
changetype: modify
replace: sstProvisioningMode
sstProvisioningMode: unretainingLargeFiles
</pre>
 
==== Step 06: Finalizing the unretainLargeFiles process (Provisioning-Backup-KVM daemon) ====
As soon as the Provisioning-Backup-KVM daemon has executed the commands to unretain the large files, it sets the '''sstProvisioningMode''' to '''unretainedLargeFiles''', the '''sstProvisioningState''' to the current timestamp (UTC) and '''sstProvisioningReturnValue''' to zero to tell the Control instance daemon and other interested parties, that the unretaining of all the large files from the configured backup location is finished.
<pre>
# The attribute sstProvisioningState is set with the current timestamp by the Provisioning-Backup-VKM daemon, when
# the attributes sstProvisioningReturnValue and sstProvisioningMode are set.
# With this combination, the Control instance daemon knows, that it can proceed.
dn: ou=20121002T010000Z,ou=backup,sstVirtualMachine=kvm-005,ou=virtual machines,ou=virtualization,ou=services,o=stepping-stone,c=ch
changetype: modify
replace: sstProvisioningState
sstProvisioningState: 20121002T012000Z
-
replace: sstProvisioningReturnValue
sstProvisioningReturnValue: 0
-
replace: sstProvisioningMode
sstProvisioningMode: unretainedLargeFiles
</pre>
 
==== Step 07: Start the restore process (Control instance daemon) ====
Since we now have all necessary files in the configured retain location, the restore process can be started. There we simply copy the disk images back to their original location and restore the VM from the state file (which is also at the configured retain location)
 
<pre>
# The attribute sstProvisioningState is set to zero by the Control instance daemon, when sstProvisioningMode is modified to
# restore (this way the Provisioning-Backup-VKM daemon knows, that it must start the restore process).
dn: ou=20121002T010000Z,ou=backup,sstVirtualMachine=kvm-005,ou=virtual machines,ou=virtualization,ou=services,o=stepping-stone,c=ch
changetype: modify
replace: sstProvisioningState
sstProvisioningState: 0
-
replace: sstProvisioningMode
sstProvisioningMode: restore
</pre>
 
==== Step 08: Starting the restore process (Provisioning-Backup-KVM daemon) ====
As soon as the Provisioning-Backup-KVM daemon receives the restore command, it sets the '''sstProvisioningMode''' to '''restoring''' to tell the Control instance daemon and other interested parties, that it is restoring the virtual machine or virtual machine template.
<pre>
# The attribute sstProvisioningMode is set to restoring by the Provisioning-Backup-VKM daemon.
dn: ou=20121002T010000Z,ou=backup,sstVirtualMachine=kvm-005,ou=virtual machines,ou=virtualization,ou=services,o=stepping-stone,c=ch
changetype: modify
replace: sstProvisioningMode
sstProvisioningMode: restoring
</pre>
 
==== Step 09: Finalizing the restore process (Provisioning-Backup-KVM daemon) ====
As soon as the Provisioning-Backup-KVM daemon has executed the restore command, it sets the '''sstProvisioningMode''' to '''restored''', the '''sstProvisioningState''' to the current timestamp (UTC) and '''sstProvisioningReturnValue''' to zero to tell the Control instance daemon and other interested parties, that the restore process is finished.
<pre>
# The attribute sstProvisioningState is set with the current timestamp by the Provisioning-Backup-VKM daemon, when
# the attributes sstProvisioningReturnValue and sstProvisioningMode are set.
# With this combination, the Control instance daemon knows, that it can proceed.
dn: ou=20121002T010000Z,ou=backup,sstVirtualMachine=kvm-005,ou=virtual machines,ou=virtualization,ou=services,o=stepping-stone,c=ch
changetype: modify
replace: sstProvisioningState
sstProvisioningState: 20121002T012000Z
-
replace: sstProvisioningReturnValue
sstProvisioningReturnValue: 0
-
replace: sstProvisioningMode
sstProvisioningMode: restored
</pre>
 
==== Step 10: Finalizing the restore process (Control instance daemon) ====
As soon as the Control instance daemon notices, that the attribute '''sstProvisioningMode''' ist set to '''restored''', it sets the '''sstProvisioningMode''' to '''finished''' and the '''sstProvisioningState''' to the current timestamp (UTC). All interested parties now know, that the restore process is finished.
<pre>
# The attribute sstProvisioningState is updated with current time by the Control instance daemon, when sstProvisioningMode is
# set to finished.
# All interested parties now know, that the restore process is finished.
dn: ou=20121002T010000Z,ou=backup,sstVirtualMachine=kvm-005,ou=virtual machines,ou=virtualization,ou=services,o=stepping-stone,c=ch
changetype: modify
replace: sstProvisioningState
sstProvisioningState: 20121002T012001Z
-
replace: sstProvisioningMode
sstProvisioningMode: finished
</pre>
== State of the art ==
486
edits