xen-drbd

diff xen-drbd.py @ 28:60ffe9018212

migrate-and-start-my-domains and migrate-and-start-all
author igor
date Wed Feb 20 15:05:56 2008 +0200 (2008-02-20)
parents a1403dbe68c0
children 311e9fe76a04
line diff
     1.1 --- a/xen-drbd.py	Wed Feb 20 11:18:43 2008 +0200
     1.2 +++ b/xen-drbd.py	Wed Feb 20 15:05:56 2008 +0200
     1.3 @@ -163,10 +163,16 @@
     1.4      for domain in domain_home[node]:
     1.5          if not domain in running_domains(node) and domain in running_domains(the_peer_of(node)):
     1.6              migrate_domain_in(domain,node)
     1.7 +
     1.8 +def migrate_and_start_my_domains(node=i_am):
     1.9 +    migrate_my_domains_home(node)
    1.10 +    start_my_domains(node)
    1.11      
    1.12  def migrate_and_start_all(node=i_am):
    1.13      migrate_my_domains_home(node)
    1.14      start_my_domains(node)
    1.15 +    migrate_my_domains_home(the_peer_of(node))
    1.16 +    start_my_domains(the_peer_of(node))
    1.17  
    1.18  def do_import(name, source):
    1.19     module = imp.new_module(name)
    1.20 @@ -202,6 +208,7 @@
    1.21      migrate-all-out
    1.22      migrate-all-in
    1.23      migrate-my-domains-home
    1.24 +    migrate-and-start-my-domains
    1.25      migrate-and-start-all
    1.26  
    1.27      dump-config domain
    1.28 @@ -256,6 +263,8 @@
    1.29          migrate_all_in()
    1.30      elif command == 'migrate-my-domains-home':
    1.31          migrate_my_domains_home()
    1.32 +    elif command == 'migrate-and-start-my-domains':
    1.33 +        migrate_and_start_my_domains()
    1.34      elif command == 'migrate-and-start-all':
    1.35          migrate_and_start_all()
    1.36      elif command == 'list':