merge r1568 from branches/ganeti/ganeti-1.2
authorAlexander Schreiber <als@google.com>
Tue, 2 Sep 2008 12:57:32 +0000 (12:57 +0000)
committerAlexander Schreiber <als@google.com>
Tue, 2 Sep 2008 12:57:32 +0000 (12:57 +0000)
Add more fields to gnt-instance list

Reviewed-by: imsnah

lib/cmdlib.py
scripts/gnt-instance

index 05e5569..b67d9fe 100644 (file)
@@ -2472,7 +2472,12 @@ class LUQueryInstances(NoHooksLU):
     _CheckOutputFields(static=["name", "os", "pnode", "snodes",
                                "admin_state", "admin_ram",
                                "disk_template", "ip", "mac", "bridge",
-                               "sda_size", "sdb_size", "vcpus", "tags"],
+                               "sda_size", "sdb_size", "vcpus", "tags",
+                               "auto_balance",
+                               "network_port", "kernel_path", "initrd_path",
+                               "hvm_boot_order", "hvm_acpi", "hvm_pae",
+                               "hvm_cdrom_image_path", "hvm_nic_type",
+                               "hvm_disk_type", "vnc_bind_address"],
                        dynamic=self.dynamic_fields,
                        selected=self.op.output_fields)
 
@@ -2593,6 +2598,18 @@ class LUQueryInstances(NoHooksLU):
           val = instance.vcpus
         elif field == "tags":
           val = list(instance.GetTags())
+        elif field in ("network_port", "kernel_path", "initrd_path",
+                       "hvm_boot_order", "hvm_acpi", "hvm_pae",
+                       "hvm_cdrom_image_path", "hvm_nic_type",
+                       "hvm_disk_type", "vnc_bind_address"):
+          val = getattr(instance, field, None)
+          if val is not None:
+            pass
+          elif field in ("hvm_nic_type", "hvm_disk_type",
+                         "kernel_path", "initrd_path"):
+            val = "default"
+          else:
+            val = "-"
         else:
           raise errors.ParameterError(field)
         iout.append(val)
index 7ec6ed6..dc3e657 100755 (executable)
@@ -184,10 +184,20 @@ def ListInstances(opts, args):
       "snodes": "Secondary_Nodes", "admin_state": "Autostart",
       "oper_state": "Running", "admin_ram": "Configured_memory",
       "oper_ram": "Memory", "disk_template": "Disk_template",
-      "ip": "IP Address", "mac": "MAC Address",
+      "ip": "IP_address", "mac": "MAC_address",
       "bridge": "Bridge", "vcpus": "VCPUs",
       "sda_size": "Disk/0", "sdb_size": "Disk/1",
       "status": "Status", "tags": "Tags",
+      "network_port": "Network_port",
+      "kernel_path": "Kernel_path",
+      "initrd_path": "Initrd_path",
+      "hvm_boot_order": "HVM_boot_order",
+      "hvm_acpi": "HVM_ACPI",
+      "hvm_pae": "HVM_PAE",
+      "hvm_cdrom_image_path": "HVM_CDROM_image_path",
+      "hvm_nic_type": "HVM_NIC_type",
+      "hvm_disk_type": "HVM_disk_type",
+      "vnc_bind_address": "VNC_bind_address",
       }
   else:
     headers = None