Revision b03efa30

b/scripts/gnt-backup
92 92

  
93 93
  (pnode, snode) = SplitNodeOption(opts.node)
94 94

  
95
  hypervisor = None
96
  hvparams = {}
97
  if opts.hypervisor:
98
    hypervisor, hvparams = opts.hypervisor
99

  
100
  ValidateBeParams(opts.beparams)
101

  
95 102
  op = opcodes.OpCreateInstance(instance_name=instance,
96 103
                                disk_size=opts.size, swap_size=opts.swap,
97 104
                                disk_template=opts.disk_template,
......
104 111
                                file_storage_dir=opts.file_storage_dir,
105 112
                                file_driver=opts.file_driver,
106 113
                                iallocator=opts.iallocator,
107
                                auto_balance=auto_balance,
108
                                hvm_boot_order=opts.hvm_boot_order,
109
                                hvm_acpi=opts.hvm_acpi,
110
                                hvm_nic_type=opts.hvm_nic_type,
111
                                hvm_disk_type=opts.hvm_disk_type,
112
                                hvm_pae=opts.hvm_pae,
113
                                hvm_cdrom_image_path=opts.hvm_cdrom_image_path,
114
                                vnc_bind_address=opts.vnc_bind_address,
115
                                beparams=ValidateBeParams(opts.beparams))
114
                                hypervisor=hypervisor,
115
                                hvparams=hvparams,
116
                                beparams=opts.beparams)
116 117

  
117 118
  SubmitOpCode(op)
118 119
  return 0
......
148 149
             default=20 * 1024, type="unit", metavar="<size>"),
149 150
  cli_option("--swap-size", dest="swap", help="Swap size",
150 151
             default=4 * 1024, type="unit", metavar="<size>"),
152
  keyval_option("-B", "--backend", dest="beparams",
153
                type="keyval", default={},
154
                help="Backend parameters"),
151 155
  make_option("-t", "--disk-template", dest="disk_template",
152 156
              help="Custom disk setup (diskless, file, plain, drbd)",
153 157
              default=None, metavar="TEMPL"),
......
175 179
              metavar="<DIR>"),
176 180
  make_option("--file-driver", dest="file_driver", help="Driver to use"
177 181
              " for image files", default="loop", metavar="<DRIVER>"),
178
  make_option("--hvm-boot-order", dest="hvm_boot_order",
179
              help="Boot device order for HVM (one or more of [acdn])",
180
              default=None, type="string", metavar="<BOOTORDER>"),
181
  make_option("--hvm-acpi", dest="hvm_acpi",
182
              help="ACPI support for HVM (true|false)",
183
              metavar="<BOOL>", choices=["true", "false"]),
184
  make_option("--hvm-nic-type", dest="hvm_nic_type",
185
              help="Type of virtual NIC for HVM "
186
              "(rtl8139,ne2k_pci,ne2k_isa,paravirtual)",
187
              metavar="NICTYPE", choices=[constants.HT_HVM_NIC_RTL8139,
188
                                          constants.HT_HVM_NIC_NE2K_PCI,
189
                                          constants.HT_HVM_NIC_NE2K_ISA,
190
                                          constants.HT_HVM_DEV_PARAVIRTUAL],
191
              default=constants.HT_HVM_NIC_RTL8139),
192
  make_option("--hvm-disk-type", dest="hvm_disk_type",
193
              help="Type of virtual disks for HVM (ioemu,paravirtual)",
194
              metavar="DISKTYPE", choices=[constants.HT_HVM_DEV_IOEMU,
195
                                           constants.HT_HVM_DEV_PARAVIRTUAL],
196
              default=constants.HT_HVM_DEV_IOEMU,),
197
  make_option("--hvm-pae", dest="hvm_pae",
198
              help="PAE support for HVM (true|false)",
199
              metavar="<BOOL>", choices=["true", "false"]),
200
  make_option("--hvm-cdrom-image-path", dest="hvm_cdrom_image_path",
201
              help="CDROM image path for HVM (absolute path or None)",
202
              default=None, type="string", metavar="<CDROMIMAGE>"),
203
  make_option("--vnc-bind-address", dest="vnc_bind_address",
204
              help="bind address for VNC (IP address)",
205
              default=None, type="string", metavar="<VNCADDRESS>"),
182
  ikv_option("-H", "--hypervisor", dest="hypervisor",
183
              help="Hypervisor and hypervisor options, in the format"
184
              " hypervisor:option=value,option=value,...", default=None,
185
              type="identkeyval"),
206 186
  ]
207 187

  
208 188
commands = {

Also available in: Unified diff