- keyval_option("-B", "--backend", dest="beparams",
- type="keyval", default={},
- help="Backend parameters"),
- make_option("-t", "--disk-template", dest="disk_template",
- help="Custom disk setup (diskless, file, plain or drbd)",
- default=None, metavar="TEMPL"),
- make_option("-i", "--ip", dest="ip",
- help="IP address ('none' [default], 'auto', or specify address)",
- default='none', type="string", metavar="<ADDRESS>"),
- make_option("--mac", dest="mac",
- help="MAC address ('auto' [default], or specify address)",
- default='auto', type="string", metavar="<MACADDRESS>"),
- make_option("--no-wait-for-sync", dest="wait_for_sync", default=True,
- action="store_false", help="Don't wait for sync (DANGEROUS!)"),
- make_option("-b", "--bridge", dest="bridge",
- help="Bridge to connect this instance to",
- default=None, metavar="<bridge>"),
- make_option("--no-start", dest="start", default=True,
- action="store_false", help="Don't start the instance after"
- " creation"),
- make_option("--no-ip-check", dest="ip_check", default=True,
- action="store_false", help="Don't check that the instance's IP"
- " is alive (only valid with --no-start)"),
- make_option("--kernel", dest="kernel_path",
- help="Path to the instances' kernel (or 'default')",
- default=None,
- type="string", metavar="<FILENAME>"),
- make_option("--initrd", dest="initrd_path",
- help="Path to the instances' initrd (or 'none', or 'default')",
- default=None,
- type="string", metavar="<FILENAME>"),
- make_option("--hvm-boot-order", dest="hvm_boot_order",
- help="Boot device order for HVM (one or more of [acdn])",
- default=None, type="string", metavar="<BOOTORDER>"),
- make_option("--file-storage-dir", dest="file_storage_dir",
- help="Relative path under default cluster-wide file storage dir"
- " to store file-based disks", default=None,
- metavar="<DIR>"),
- make_option("--file-driver", dest="file_driver", help="Driver to use"
- " for image files", default="loop", metavar="<DRIVER>"),
- make_option("--iallocator", metavar="<NAME>",
- help="Select nodes for the instance automatically using the"
- " <NAME> iallocator plugin", default=None, type="string"),
- ikv_option("-H", "--hypervisor", dest="hypervisor",
- help="Hypervisor and hypervisor options, in the format"
- " hypervisor:option=value,option=value,...", default=None,
- type="identkeyval"),
- make_option("--vnc-bind-address", dest="vnc_bind_address",
- help="bind address for VNC (IP address)",
- default=None, type="string", metavar="<VNCADDRESS>"),
+ cli_option("-B", "--backend", dest="beparams",
+ type="keyval", default={},
+ help="Backend parameters"),
+ cli_option("-t", "--disk-template", dest="disk_template",
+ help="Custom disk setup (diskless, file, plain or drbd)",
+ default=None, metavar="TEMPL",
+ choices=list(constants.DISK_TEMPLATES)),
+ cli_option("-s", "--os-size", dest="sd_size", help="Disk size for a"
+ " single-disk configuration, when not using the --disk option,"
+ " in MiB unless a suffix is used",
+ default=None, type="unit", metavar="<size>"),
+ cli_option("--disk", help="Disk information",
+ default=[], dest="disks",
+ action="append",
+ type="identkeyval"),
+ cli_option("--net", help="NIC information",
+ default=[], dest="nics",
+ action="append",
+ type="identkeyval"),
+ cli_option("--no-nics", default=False, action="store_true",
+ help="Do not create any network cards for the instance"),
+ cli_option("--no-wait-for-sync", dest="wait_for_sync", default=True,
+ action="store_false", help="Don't wait for sync (DANGEROUS!)"),
+ cli_option("--no-start", dest="start", default=True,
+ action="store_false", help="Don't start the instance after"
+ " creation"),
+ cli_option("--no-ip-check", dest="ip_check", default=True,
+ action="store_false", help="Don't check that the instance's IP"
+ " is alive (only valid with --no-start)"),
+ cli_option("--file-storage-dir", dest="file_storage_dir",
+ help="Relative path under default cluster-wide file storage dir"
+ " to store file-based disks", default=None,
+ metavar="<DIR>"),
+ cli_option("--file-driver", dest="file_driver", help="Driver to use"
+ " for image files", default="loop", metavar="<DRIVER>",
+ choices=list(constants.FILE_DRIVER)),
+ cli_option("-I", "--iallocator", metavar="<NAME>",
+ help="Select nodes for the instance automatically using the"
+ " <NAME> iallocator plugin", default=None, type="string",
+ completion_suggest=OPT_COMPL_ONE_IALLOCATOR),
+ cli_option("-H", "--hypervisor", dest="hypervisor",
+ help="Hypervisor and hypervisor options, in the format"
+ " hypervisor:option=value,option=value,...", default=None,
+ type="identkeyval"),