This commit is contained in:
ahmadbilalkhalid 2019-09-16 19:37:03 +05:00
parent f0af8aec72
commit f704772c6c

View file

@ -4,35 +4,26 @@
# For QEMU Monitor Protocol Commands Information, See
# https://qemu.weilnetz.de/doc/qemu-doc.html#pcsys_005fmonitor
import subprocess
import traceback
import errno
import os
import subprocess
import tempfile
import time
import os
import traceback
from functools import wraps
from os.path import join
from typing import Union
from functools import wraps
import bitmath
import sshtunnel
from decouple import config
from ucloud_common.helpers import get_ipv4_address
from ucloud_common.vm import VMStatus, VMEntry
from ucloud_common.request import RequestEntry, RequestType
import qmp
from config import (
vm_pool,
request_pool,
etcd_client,
logging,
running_vms,
WITHOUT_CEPH,
)
from config import (WITHOUT_CEPH, etcd_client, logging, request_pool,
running_vms, vm_pool)
from ucloud_common.helpers import get_ipv4_address
from ucloud_common.request import RequestEntry, RequestType
from ucloud_common.vm import VMEntry, VMStatus
class VM:
@ -187,6 +178,7 @@ def start(vm_entry: VMEntry):
except (qmp.QEMUMachineError, TypeError, Exception):
vm_entry.declare_killed()
vm_entry.add_log("Machine Error occurred | %s", traceback.format_exc())
vm_entry.vnc_socket = vm.vnc_socket_file
vm_pool.put(vm_entry)
else:
running_vms.append(vm)
@ -296,6 +288,8 @@ def init_migration(vm_entry, destination_host_key):
vm.handle.shutdown()
else:
vm_entry.in_migration = True
vm_entry.vnc_socket = vm.vnc_socket_file
vm_pool.put(vm_entry)
running_vms.append(vm)