Revision 6785674e scripts/gnt-instance

b/scripts/gnt-instance
266 266

  
267 267
  (pnode, snode) = SplitNodeOption(opts.node)
268 268

  
269
  kernel_path = _TransformPath(opts.kernel_path)
270
  initrd_path = _TransformPath(opts.initrd_path)
269
  hypervisor = None
270
  hvparams = {}
271
  if opts.hypervisor:
272
    hypervisor, hvparams = opts.hypervisor
271 273

  
272
  hvm_acpi = opts.hvm_acpi == _VALUE_TRUE
273
  hvm_pae = opts.hvm_pae == _VALUE_TRUE
274
##  kernel_path = _TransformPath(opts.kernel_path)
275
##  initrd_path = _TransformPath(opts.initrd_path)
274 276

  
275
  if ((opts.hvm_cdrom_image_path is not None) and
276
      (opts.hvm_cdrom_image_path.lower() == constants.VALUE_NONE)):
277
    hvm_cdrom_image_path = None
278
  else:
279
    hvm_cdrom_image_path = opts.hvm_cdrom_image_path
277
##  hvm_acpi = opts.hvm_acpi == _VALUE_TRUE
278
##  hvm_pae = opts.hvm_pae == _VALUE_TRUE
279

  
280
##  if ((opts.hvm_cdrom_image_path is not None) and
281
##      (opts.hvm_cdrom_image_path.lower() == constants.VALUE_NONE)):
282
##    hvm_cdrom_image_path = None
283
##  else:
284
##    hvm_cdrom_image_path = opts.hvm_cdrom_image_path
280 285

  
281 286
  op = opcodes.OpCreateInstance(instance_name=instance, mem_size=opts.mem,
282 287
                                disk_size=opts.size, swap_size=opts.swap,
......
288 293
                                start=opts.start, ip_check=opts.ip_check,
289 294
                                wait_for_sync=opts.wait_for_sync,
290 295
                                mac=opts.mac,
291
                                kernel_path=kernel_path,
292
                                initrd_path=initrd_path,
296
                                hypervisor=hypervisor,
297
                                hvparams=hvparams,
293 298
                                iallocator=opts.iallocator,
294
                                hvm_boot_order=opts.hvm_boot_order,
295 299
                                file_storage_dir=opts.file_storage_dir,
296 300
                                file_driver=opts.file_driver,
297
                                hvm_acpi=hvm_acpi, hvm_pae=hvm_pae,
298
                                hvm_cdrom_image_path=hvm_cdrom_image_path,
299
                                vnc_bind_address=opts.vnc_bind_address,
300
                                hvm_nic_type=opts.hvm_nic_type,
301
                                hvm_disk_type=opts.hvm_disk_type)
301
                                )
302 302

  
303 303
  SubmitOrSend(op, opts)
304 304
  return 0
......
918 918
  make_option("--iallocator", metavar="<NAME>",
919 919
              help="Select nodes for the instance automatically using the"
920 920
              " <NAME> iallocator plugin", default=None, type="string"),
921
  make_option("--hvm-acpi", dest="hvm_acpi",
922
              help="ACPI support for HVM (true|false)",
923
              metavar="<BOOL>", choices=["true", "false"]),
924
  make_option("--hvm-nic-type", dest="hvm_nic_type",
925
              help="Type of virtual NIC for HVM "
926
              "(rtl8139,ne2k_pci,ne2k_isa,paravirtual)",
927
              metavar="NICTYPE", choices=[constants.HT_HVM_NIC_RTL8139,
928
                                          constants.HT_HVM_NIC_NE2K_PCI,
929
                                          constants.HT_HVM_NIC_NE2K_ISA,
930
                                          constants.HT_HVM_DEV_PARAVIRTUAL],
931
              default=constants.HT_HVM_NIC_RTL8139),
932
  make_option("--hvm-disk-type", dest="hvm_disk_type",
933
              help="Type of virtual disks for HVM (ioemu,paravirtual)",
934
              metavar="DISKTYPE", choices=[constants.HT_HVM_DEV_IOEMU,
935
                                           constants.HT_HVM_DEV_PARAVIRTUAL],
936
              default=constants.HT_HVM_DEV_IOEMU,),
937
  make_option("--hvm-pae", dest="hvm_pae",
938
              help="PAE support for HVM (true|false)",
939
              metavar="<BOOL>", choices=["true", "false"]),
940
  make_option("--hvm-cdrom-image-path", dest="hvm_cdrom_image_path",
941
              help="CDROM image path for HVM (absolute path or None)",
942
              default=None, type="string", metavar="<CDROMIMAGE>"),
921
  ikv_option("-H", "--hypervisor", dest="hypervisor",
922
              help="Hypervisor and hypervisor options, in the format"
923
              " hypervisor:option=value,option=value,...", default=None,
924
              type="identkeyval"),
943 925
  make_option("--vnc-bind-address", dest="vnc_bind_address",
944 926
              help="bind address for VNC (IP address)",
945 927
              default=None, type="string", metavar="<VNCADDRESS>"),

Also available in: Unified diff