(OVF_SCHEMA, OVF_SCHEMA))
network_names = self._GetAttributes(networks_search,
"{%s}name" % OVF_SCHEMA)
- required = ["ip", "mac", "link", "mode"]
+ required = ["ip", "mac", "link", "mode", "network"]
for (counter, network_name) in enumerate(network_names):
network_search = ("{%s}VirtualSystem/{%s}VirtualHardwareSection/{%s}Item"
% (OVF_SCHEMA, OVF_SCHEMA, OVF_SCHEMA))
GANETI_SCHEMA)
ganeti_data["link"] = network_ganeti_data.findtext("{%s}Link" %
GANETI_SCHEMA)
+ ganeti_data["network"] = network_ganeti_data.findtext("{%s}Net" %
+ GANETI_SCHEMA)
mac_data = None
if network_data:
mac_data = network_data.findtext("{%s}Address" % RASD_SCHEMA)
SubElementText(nic, "gnt:MACAddress", network["mac"])
SubElementText(nic, "gnt:IPAddress", network["ip"])
SubElementText(nic, "gnt:Link", network["link"])
+ SubElementText(nic, "gnt:Net", network["network"])
def SaveVirtualSystemData(self, name, vcpus, memory):
"""Convert virtual system information to OVF sections.
results["nic%s_mac" % nic_id] = nic_desc.get("mac", constants.VALUE_AUTO)
results["nic%s_link" % nic_id] = \
nic_desc.get("link", constants.VALUE_AUTO)
+ results["nic%s_network" % nic_id] = \
+ nic_desc.get("network", constants.VALUE_AUTO)
if nic_desc.get("mode") == "bridged":
results["nic%s_ip" % nic_id] = constants.VALUE_NONE
else:
counter = 0
while True:
data_link = \
- self.config_parser.get(constants.INISECT_INS, "nic%s_link" % counter)
+ self.config_parser.get(constants.INISECT_INS,
+ "nic%s_link" % counter)
if data_link is None:
break
results.append({
"nic%s_mac" % counter),
"ip": self.config_parser.get(constants.INISECT_INS,
"nic%s_ip" % counter),
+ "network": self.config_parser.get(constants.INISECT_INS,
+ "nic%s_network" % counter),
"link": data_link,
})
if results[counter]["mode"] not in constants.NIC_VALID_MODES: