Exemplo n.º 1
0
def main(argv):
    opts = gopts
    opts.reset()
    args = opts.parse(argv)

    if len(args) != 2:
        raise OptionError('Invalid number of arguments')

    dom = args[0]
    dst = args[1]

    if serverType == SERVER_XEN_API:
        vm_ref = get_single_vm(dom)
        other_config = {
            "port": opts.vals.port,
            "node": opts.vals.node,
            "ssl": opts.vals.ssl,
            "change_home_server": opts.vals.change_home_server,
            "change_destination_core": opts.vals.change_destination_core
        }
        server.xenapi.VM.migrate(vm_ref, dst, bool(opts.vals.live),
                                 other_config)
    else:
        server.xend.domain.migrate(dom, dst, opts.vals.live, opts.vals.port,
                                   opts.vals.node, opts.vals.ssl,
                                   opts.vals.change_home_server,
                                   opts.vals.change_destination_core)
Exemplo n.º 2
0
def main(argv):
    opts = gopts
    opts.reset()
    args = opts.parse(argv)

    if len(args) != 2:
        raise OptionError('Invalid number of arguments')

    dom = args[0]
    dst = args[1]

    if serverType == SERVER_XEN_API:
        vm_ref = get_single_vm(dom)
        other_config = {
            "port": opts.vals.port,
            "node": opts.vals.node,
            "ssl": opts.vals.ssl,
            "change_home_server": opts.vals.change_home_server
        }
        server.xenapi.VM.migrate(vm_ref, dst, bool(opts.vals.live),
                                 other_config)
    else:
        server.xend.domain.migrate_constraints_set(dom, opts.vals.max_iters,
                                                   opts.vals.max_factor,
                                                   opts.vals.min_remaining,
                                                   opts.vals.abort_if_busy,
                                                   opts.vals.log_progress)
        server.xend.domain.migrate(dom, dst, opts.vals.live, opts.vals.port,
                                   opts.vals.node, opts.vals.ssl,
                                   opts.vals.change_home_server)
Exemplo n.º 3
0
def main(argv):
    opts = gopts
    opts.reset()
    args = opts.parse(argv)
    
    if len(args) != 2:
        raise OptionError('Invalid number of arguments')

    dom = args[0]
    dst = args[1]

    if serverType == SERVER_XEN_API:
        vm_ref = get_single_vm(dom)
        other_config = {
            "port":     opts.vals.port,
            "node":     opts.vals.node,
            "ssl":      opts.vals.ssl,
            "change_home_server": opts.vals.change_home_server
            }
        server.xenapi.VM.migrate(vm_ref, dst, bool(opts.vals.live),
                                 other_config)
    else:
        server.xend.domain.migrate(dom, dst, opts.vals.live,
                                   opts.vals.port,
                                   opts.vals.node,
                                   opts.vals.ssl,
                                   opts.vals.change_home_server)
Exemplo n.º 4
0
def main_dom(opts, args):
    if len(args) == 0: opts.err('No domain parameter given')
    if len(args) > 1: opts.err('No multiple domain parameters allowed')
    dom = args[0]
    if serverType == SERVER_XEN_API:
        dom = get_single_vm(dom)
    mode = shutdown_mode(opts)
    shutdown(opts, [dom], mode, opts.vals.wait)
Exemplo n.º 5
0
def main_dom(opts, args):
    if len(args) == 0: opts.err('No domain parameter given')
    if len(args) >  1: opts.err('No multiple domain parameters allowed')
    dom = args[0]
    if serverType == SERVER_XEN_API:
        dom = get_single_vm(dom)
    mode = shutdown_mode(opts)  
    shutdown(opts, [ dom ], mode, opts.vals.wait)
Exemplo n.º 6
0
def main_dom(opts, args):
    if len(args) == 0: opts.err('No domain parameter given')
    if len(args) > 1: opts.err('No multiple domain parameters allowed')
    if serverType == SERVER_XEN_API:
        dom = get_single_vm(args[0])
    else:
        dom = sxp.child_value(server.xend.domain(args[0]), 'name')
    mode = shutdown_mode(opts)
    shutdown(opts, [dom], mode, opts.vals.wait)
Exemplo n.º 7
0
def main_dom(opts, args):
    if len(args) == 0: opts.err('No domain parameter given')
    if len(args) >  1: opts.err('No multiple domain parameters allowed')
    if serverType == SERVER_XEN_API:
        dom = get_single_vm(args[0])
    else:
        dom = sxp.child_value(server.xend.domain(args[0]), 'name')
    mode = shutdown_mode(opts)  
    shutdown(opts, [ dom ], mode, opts.vals.wait)
Exemplo n.º 8
0
def main(argv):
    opts = gopts
    opts.reset()
    args = opts.parse(argv)
    
    if len(args) != 2:
        raise OptionError('Invalid number of arguments')

    dom = args[0]
    dst = args[1]

    if serverType == SERVER_XEN_API:
        vm_ref = get_single_vm(dom)
        other_config = {
            "port":     opts.vals.port,
            "resource": opts.vals.resource
            }
        server.xenapi.VM.migrate(vm_ref, dst, bool(opts.vals.live),
                                 other_config)
    else:
        server.xend.domain.migrate(dom, dst, opts.vals.live,
                                   opts.vals.resource,
                                   opts.vals.port)