Exemplo n.º 1
0
def import_xva(args):
    xenhost = Server(args.host, args.xsuser, args.xspass)
    xenhost.disable_known_hosts = True

    if args.source_xva not in lib.xvas(xenhost):
        raise SystemExit('No xva found with name [{source_xva}]'.format(
            source_xva=args.source_xva))
    if lib.no_vm_with_name(xenhost, args.target_vm):
        lib.import_xva(xenhost, args.source_xva, args.target_vm)
    else:
        raise SystemExit('VM [{target_vm}] already exists'.format(
            target_vm=args.target_vm))
Exemplo n.º 2
0
def command(user, password, host, guest):
    xenhost = boxes.Server(host, user, password)
    xenhost.disable_known_hosts = True
    return lib.no_vm_with_name(xenhost, guest)