Changes between Initial Version and Version 1 of Web/VirtualMachinesMigration


Ignore:
Timestamp:
Mar 20, 2010, 10:32:26 PM (14 years ago)
Author:
loomis
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Web/VirtualMachinesMigration

    v1 v1  
     1[[TracNav]]
     2
     3= Introduction =
     4A hot topic on computing nowadays is virtualization, and virtual machine migration. Quattor already supports creation, destruction and management of virtual machines. But no work has been done yet on VM migration.
     5Here I propose a couple of additions to current VM structures that would allow the component to make the decision on where the VM should be located and trigger migrations, if needed. The basic idea is that, although a migration is an action, the VMs running are clearly part of the host's state.
     6
     7= Data structures =
     8VMs are declared as usual, on ncm-xen and ncm-openvz components. But if we add two fields, migration is possible:
     9
     10 master : fqdn
     11 host : fqdn
     12
     13<tt>master</tt> is the name of the physical machine that is expected to usually own the VM. This PM is responsible for creating the VM.
     14<tt>host</tt> is the name of the PM where the machine must be actually running. When this changes a migration must be triggered.
     15
     16= How it should behave =
     17This is the pseudo-code the components should have. {{$guest}} is the VM description.
     18
     19 if (!$profile->contains($guest)) {
     20    destroy($guest)
     21 } elsif ($guest->master = $guest->host = hostname()) {
     22    if (!running($guest)) {
     23       create($guest);
     24    }
     25 } elsif ($guest->host != hostname() && i_am_hosting($guest)) {
     26    migrate($guest, $guest->host);
     27 } else {
     28    do_nothing();
     29 }
     30
     31So, only the master is allowed to create a given VM. Then, a VM description is included by a pool of physical machines. The component will, as usual, check its current state and if it doesn't match with the profile, trigger the appropriate actions.
     32
     33= An example =
     34So, suppose we have two physical machines, called Springfield and Shelbyville. And we have Homer, Marge, Bart, Lisa and Maggie hosted on Springfield. But Bart grows up (he should be 28 by now, why is he still in 3rd grade??) and there is no room for him in Springfield, so he moves to Shelbyville. Let's explain this in Pan language:
     35Springfield city looks like this:
     36
     37 object template springfield;
     38 
     39 # Let's declare the VMs
     40 include {"simpsons/homer"};
     41 include {"simpsons/marge"};
     42 include {"simpsons/lisa"};
     43 include {"simpsons/bart"}:
     44 include {"simpsons/maggie"};
     45
     46 ...
     47
     48And Shelbyville is well aware of the existence of the Simpson family, although they don't live there.
     49
     50 object template shelbyville;
     51 
     52 # Let's declare the VMs
     53 include {"vms/simpsons/homer"};
     54 include {"vms/simpsons/marge"};
     55 include {"vms/simpsons/lisa"};
     56 include {"vms/simpsons/bart"}:
     57 include {"vms/simpsons/maggie"};
     58 
     59 ...
     60
     61Similar, right? But now, let's describe how Bart is seen by both cities:
     62
     63 template vms/simpsons/bart;
     64 
     65 "/software/components/<virt>/guests" = npush (
     66     "bart", nlist (...
     67         "master", "springfield",
     68     "host", "springfield"
     69     )
     70     );
     71
     72Easy to remember: Bart is born in Springfield and lives on Springfield. Now, to trigger a migration just change the above template to this:
     73
     74 template vms/simpsons/bart;
     75 
     76 "/software/components/<virt>/guests" = npush (
     77     "bart", nlist (...
     78         "master", "springfield",
     79     "host", "shelbyville"
     80     )
     81 );
     82
     83And now, no matter where Bart was living, he will move to Shelbyville.
     84
     85= Warning!! =
     86The PM hosting a virtual machine is also allowed to destroy it. So, if you remove the bart line on shelbyville's profile after Bart has moved there, Bart will die.
     87
     88= To be thought =
     89* How to detect a scheduled downtime on a VM and avoid triggering a new VM machine creation? Perhaps we should check something on the guest's {{/system/maintenance}}?
     90