Commit 58acb49d authored by Alexander Schreiber's avatar Alexander Schreiber
Browse files

Add instance port support.

Extends the instance object by adding a port item, also adds changes
to print this port via gnt-instance info.

Reviewed-by: iustinp
parent bb987157
......@@ -3028,6 +3028,8 @@ class LUCreateInstance(LogicalUnit):
if self.inst_ip is not None:
nic.ip = self.inst_ip
network_port = None # placeholder assignment for later
disks = _GenerateDiskTemplate(self.cfg,
self.op.disk_template,
instance, pnode_name,
......@@ -3041,6 +3043,7 @@ class LUCreateInstance(LogicalUnit):
nics=[nic], disks=disks,
disk_template=self.op.disk_template,
status=self.instance_status,
network_port=network_port,
)
feedback_fn("* creating instance disks...")
......@@ -4001,6 +4004,7 @@ class LUQueryInstanceData(NoHooksLU):
"memory": instance.memory,
"nics": [(nic.mac, nic.ip, nic.bridge) for nic in instance.nics],
"disks": disks,
"network_port": instance.network_port,
"vcpus": instance.vcpus,
}
......
......@@ -25,7 +25,7 @@ from ganeti import _autoconf
# various versions
CONFIG_VERSION = 3
PROTOCOL_VERSION = 8
PROTOCOL_VERSION = 9
RELEASE_VERSION = _autoconf.PACKAGE_VERSION
OS_API_VERSION = 5
EXPORT_VERSION = 0
......
......@@ -490,6 +490,7 @@ class Instance(TaggableObject):
"nics",
"disks",
"disk_template",
"network_port",
]
def _ComputeSecondaryNodes(self):
......
......@@ -596,6 +596,7 @@ def ShowInstanceConfig(opts, args):
buf.write(" - primary: %s\n" % instance["pnode"])
buf.write(" - secondaries: %s\n" % ", ".join(instance["snodes"]))
buf.write(" Operating system: %s\n" % instance["os"])
buf.write(" Allocated network port: %s\n" % instance["network_port"])
buf.write(" Hardware:\n")
buf.write(" - VCPUs: %d\n" % instance["vcpus"])
buf.write(" - memory: %dMiB\n" % instance["memory"])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment