- buf.write(" Allocated network port: %s\n" % instance["network_port"])
- if instance["kernel_path"] in (None, constants.VALUE_DEFAULT):
- kpath = "(default: %s)" % constants.XEN_KERNEL
- else:
- kpath = instance["kernel_path"]
- buf.write(" Kernel path: %s\n" % kpath)
- if instance["initrd_path"] in (None, constants.VALUE_DEFAULT):
- initrd = "(default: %s)" % constants.XEN_INITRD
- elif instance["initrd_path"] == constants.VALUE_NONE:
- initrd = "(none)"
+ if instance.has_key("network_port"):
+ buf.write(" Allocated network port: %s\n" % instance["network_port"])
+ buf.write(" Hypervisor: %s\n" % instance["hypervisor"])
+ if instance["hypervisor"] == constants.HT_XEN_PVM:
+ hvattrs = ((constants.HV_KERNEL_PATH, "kernel path"),
+ (constants.HV_INITRD_PATH, "initrd path"))
+ elif instance["hypervisor"] == constants.HT_XEN_HVM:
+ hvattrs = ((constants.HV_BOOT_ORDER, "boot order"),
+ (constants.HV_ACPI, "ACPI"),
+ (constants.HV_PAE, "PAE"),
+ (constants.HV_CDROM_IMAGE_PATH, "virtual CDROM"),
+ (constants.HV_NIC_TYPE, "NIC type"),
+ (constants.HV_DISK_TYPE, "Disk type"),
+ (constants.HV_VNC_BIND_ADDRESS, "VNC bind address"),
+ )
+ # custom console information for HVM
+ vnc_bind_address = instance["hv_actual"][constants.HV_VNC_BIND_ADDRESS]
+ if vnc_bind_address == constants.BIND_ADDRESS_GLOBAL:
+ vnc_console_port = "%s:%s" % (instance["pnode"],
+ instance["network_port"])
+ elif vnc_bind_address == constants.LOCALHOST_IP_ADDRESS:
+ vnc_console_port = "%s:%s on node %s" % (vnc_bind_address,
+ instance["network_port"],
+ instance["pnode"])
+ else:
+ vnc_console_port = "%s:%s" % (vnc_bind_address,
+ instance["network_port"])
+ buf.write(" - console connection: vnc to %s\n" % vnc_console_port)
+