fixed tap id for each NIC, add more logging when VM is declared killed
This commit is contained in:
parent
66b7cf525f
commit
bbe09667a6
3 changed files with 21 additions and 12 deletions
|
|
@ -36,6 +36,8 @@ class CreateVM(Resource):
|
|||
"hdd": validator.specs["hdd"],
|
||||
}
|
||||
macs = [generate_mac() for i in range(len(data["network"]))]
|
||||
tap_ids = [counters.increment_etcd_counter(etcd_client, "/v1/counter/tap")
|
||||
for i in range(len(data["network"]))]
|
||||
vm_entry = {
|
||||
"name": data["vm_name"],
|
||||
"owner": data["name"],
|
||||
|
|
@ -46,7 +48,7 @@ class CreateVM(Resource):
|
|||
"image_uuid": validator.image_uuid,
|
||||
"log": [],
|
||||
"vnc_socket": "",
|
||||
"network": list(zip(data["network"], macs)),
|
||||
"network": list(zip(data["network"], macs, tap_ids)),
|
||||
"metadata": {"ssh-keys": []},
|
||||
}
|
||||
etcd_client.put(vm_key, vm_entry, value_in_json=True)
|
||||
|
|
@ -73,8 +75,8 @@ class VmStatus(Resource):
|
|||
)
|
||||
vm_value = vm.value.copy()
|
||||
vm_value["ip"] = []
|
||||
for network_and_mac in vm.network:
|
||||
network_name, mac = network_and_mac
|
||||
for network_mac_and_tap in vm.network:
|
||||
network_name, mac, tap = network_mac_and_tap
|
||||
network = etcd_client.get(
|
||||
join_path(
|
||||
env_vars.get("NETWORK_PREFIX"),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue