diff --git a/kvmagent/kvmagent/plugins/tf_net_userdata_plugin.py b/kvmagent/kvmagent/plugins/tf_net_userdata_plugin.py index efe7433e3f9b5ab30897c1ca4f4197ff3babb74c..c8eab3a90912ca718bb893bb9d2ae9e237898c2f 100644 --- a/kvmagent/kvmagent/plugins/tf_net_userdata_plugin.py +++ b/kvmagent/kvmagent/plugins/tf_net_userdata_plugin.py @@ -243,9 +243,9 @@ class TfNetProviderUserdata(kvmagent.KvmAgent): linux.mkdir('/var/log/lighttpd', 0o750) # restart lighttpd to load new configuration shell.call('lighttpd -f %s' % conf_path) - if not linux.wait_callback_success(check, None, 5): + if not linux.wait_callback_success(check, None, 10): raise Exception('lighttpd[conf-file:%s] is not running ' - 'after being started %s seconds' % (conf_path, 5)) + 'after being started %s seconds' % (conf_path, 10)) @kvmagent.replyerror def release_userdata_for_tf(self, req): diff --git a/kvmagent/kvmagent/plugins/vm_plugin.py b/kvmagent/kvmagent/plugins/vm_plugin.py index 4b2f7cd776b466eb3071f1650631fc73a4b7cf97..ea7a3b6407b4b34e96a60da6897ef9de662b88a8 100644 --- a/kvmagent/kvmagent/plugins/vm_plugin.py +++ b/kvmagent/kvmagent/plugins/vm_plugin.py @@ -5533,6 +5533,15 @@ class VmPlugin(kvmagent.KvmAgent): try: self._record_operation(cmd.uuid, self.VM_OP_STOP) self._stop_vm(cmd) + # notify vrouter agent nic removed from source host + for nic in cmd.nics: + if nic.type == 'TFVNIC': + vrouter_cmd = [ + 'vrouter-port-control', + '--oper=delete', + '--uuid=%s' % transform_to_tf_uuid(nic.uuid) + ] + notify_vrouter(vrouter_cmd) logger.debug("successfully stopped vm[uuid:%s]" % cmd.uuid) except kvmagent.KvmError as e: logger.warn(linux.get_exception_stacktrace()) @@ -5599,6 +5608,15 @@ class VmPlugin(kvmagent.KvmAgent): if vm: vm.destroy() ovs.OvsCtl().freeVdpa(cmd.uuid) + # notify vrouter agent nic removed from source host + for nic in cmd.vmNics: + if nic.type == 'TFVNIC': + vrouter_cmd = [ + 'vrouter-port-control', + '--oper=delete', + '--uuid=%s' % transform_to_tf_uuid(nic.uuid) + ] + notify_vrouter(vrouter_cmd) logger.debug('successfully destroyed vm[uuid:%s]' % cmd.uuid) except kvmagent.KvmError as e: logger.warn(linux.get_exception_stacktrace())