Revision 4ea3de4e

b/lib/cmdlib.py
5063 5063
                                   if name not in constants.HVC_GLOBALS] +
5064 5064
                                  ["be/%s" % name
5065 5065
                                   for name in constants.BES_PARAMETERS])
5066
  _FIELDS_DYNAMIC = utils.FieldSet("oper_state", "oper_ram", "status")
5066
  _FIELDS_DYNAMIC = utils.FieldSet("oper_state",
5067
                                   "oper_ram",
5068
                                   "oper_vcpus",
5069
                                   "status")
5067 5070

  
5068 5071

  
5069 5072
  def CheckArguments(self):
......
5194 5197
            val = live_data[instance.name].get("memory", "?")
5195 5198
          else:
5196 5199
            val = "-"
5200
        elif field == "oper_vcpus":
5201
          if instance.primary_node in bad_nodes:
5202
            val = None
5203
          elif instance.name in live_data:
5204
            val = live_data[instance.name].get("vcpus", "?")
5205
          else:
5206
            val = "-"
5197 5207
        elif field == "vcpus":
5198 5208
          val = i_be[constants.BE_VCPUS]
5199 5209
        elif field == "disk_template":
b/lib/rapi/rlib2.py
58 58
            "network_port",
59 59
            "disk.sizes", "disk_usage",
60 60
            "beparams", "hvparams",
61
            "oper_state", "oper_ram", "status",
61
            "oper_state", "oper_ram", "oper_vcpus", "status",
62 62
            ] + _COMMON_FIELDS
63 63

  
64 64
N_FIELDS = ["name", "offline", "master_candidate", "drained",
b/man/gnt-instance.sgml
1150 1150
              </listitem>
1151 1151
            </varlistentry>
1152 1152
            <varlistentry>
1153
              <term>oper_vcpus</term>
1154
              <listitem>
1155
                <simpara>the actual number of VCPUs the instance is using
1156
                  as seen by the hypervisor</simpara>
1157
              </listitem>
1158
            </varlistentry>
1159
            <varlistentry>
1153 1160
              <term>ip</term>
1154 1161
              <listitem>
1155 1162
                <simpara>the ip address Ganeti recognizes as associated with
......
1400 1407
        <para>
1401 1408
          There is a subtle grouping about the available output
1402 1409
          fields: all fields except for <option>oper_state</option>,
1403
          <option>oper_ram</option> and <option>status</option> are
1410
          <option>oper_ram</option>, <option>oper_vcpus</option> and
1411
          <option>status</option> are
1404 1412
          configuration value and not run-time values. So if you don't
1405 1413
          select any of the these fields, the query will be satisfied
1406 1414
          instantly from the cluster configuration, without having to
b/qa/qa_rapi.py
88 88
                   "disk_template", "disk.sizes",
89 89
                   "nic.ips", "nic.macs", "nic.modes", "nic.links",
90 90
                   "beparams", "hvparams",
91
                   "oper_state", "oper_ram", "status", "tags")
91
                   "oper_state", "oper_ram", "oper_vcpus", "status", "tags")
92 92

  
93 93
NODE_FIELDS = ("name", "dtotal", "dfree",
94 94
               "mtotal", "mnode", "mfree",
b/scripts/gnt-instance
258 258
      "snodes": "Secondary_Nodes", "admin_state": "Autostart",
259 259
      "oper_state": "Running",
260 260
      "oper_ram": "Memory", "disk_template": "Disk_template",
261
      "oper_vcpus": "VCPUs",
261 262
      "ip": "IP_address", "mac": "MAC_address",
262 263
      "nic_mode": "NIC_Mode", "nic_link": "NIC_Link",
263 264
      "bridge": "Bridge",
......
316 317
      elif field == "oper_ram":
317 318
        if val is None:
318 319
          val = "(node down)"
320
      elif field == "oper_vcpus":
321
        if val is None:
322
          val = "(node down)"
319 323
      elif field == "sda_size" or field == "sdb_size":
320 324
        if val is None:
321 325
          val = "N/A"
......
1423 1427
    "[<instance>...]",
1424 1428
    "Lists the instances and their status. The available fields are"
1425 1429
    " (see the man page for details): status, oper_state, oper_ram,"
1426
    " name, os, pnode, snodes, admin_state, admin_ram, disk_template,"
1427
    " ip, mac, nic_mode, nic_link, sda_size, sdb_size, vcpus, serial_no,"
1430
    " oper_vcpus, name, os, pnode, snodes, admin_state, admin_ram,"
1431
    " disk_template, ip, mac, nic_mode, nic_link, sda_size, sdb_size,"
1432
    " vcpus, serial_no,"
1428 1433
    " nic.count, nic.mac/N, nic.ip/N, nic.mode/N, nic.link/N,"
1429 1434
    " nic.macs, nic.ips, nic.modes, nic.links,"
1430 1435
    " disk.count, disk.size/N, disk.sizes,"

Also available in: Unified diff