Skip to content

Commit 26214ea

Browse files
committed
Merge remote-tracking branch 'apache/4.18'
2 parents 6d916ca + d83d994 commit 26214ea

File tree

2 files changed

+35
-6
lines changed

2 files changed

+35
-6
lines changed

engine/orchestration/src/main/java/com/cloud/vm/VirtualMachineManagerImpl.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,7 @@ private boolean isValidSystemVMType(VirtualMachine vm) {
602602
protected void advanceExpunge(VMInstanceVO vm) throws ResourceUnavailableException, OperationTimedoutException, ConcurrentOperationException {
603603
if (vm == null || vm.getRemoved() != null) {
604604
if (s_logger.isDebugEnabled()) {
605-
s_logger.debug("Unable to find vm or vm is destroyed: " + vm);
605+
s_logger.debug("Unable to find vm or vm is expunged: " + vm);
606606
}
607607
return;
608608
}
@@ -612,17 +612,17 @@ protected void advanceExpunge(VMInstanceVO vm) throws ResourceUnavailableExcepti
612612

613613
try {
614614
if (!stateTransitTo(vm, VirtualMachine.Event.ExpungeOperation, vm.getHostId())) {
615-
s_logger.debug("Unable to destroy the vm because it is not in the correct state: " + vm);
616-
throw new CloudRuntimeException("Unable to destroy " + vm);
615+
s_logger.debug("Unable to expunge the vm because it is not in the correct state: " + vm);
616+
throw new CloudRuntimeException("Unable to expunge " + vm);
617617

618618
}
619619
} catch (final NoTransitionException e) {
620-
s_logger.debug("Unable to destroy the vm because it is not in the correct state: " + vm);
621-
throw new CloudRuntimeException("Unable to destroy " + vm, e);
620+
s_logger.debug("Unable to expunge the vm because it is not in the correct state: " + vm);
621+
throw new CloudRuntimeException("Unable to expunge " + vm, e);
622622
}
623623

624624
if (s_logger.isDebugEnabled()) {
625-
s_logger.debug("Destroying vm " + vm);
625+
s_logger.debug("Expunging vm " + vm);
626626
}
627627

628628
final VirtualMachineProfile profile = new VirtualMachineProfileImpl(vm);

test/integration/smoke/test_vm_life_cycle.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1011,8 +1011,37 @@ def setUpClass(cls):
10111011

10121012
@classmethod
10131013
def tearDownClass(cls):
1014+
if cls.hypervisor.lower() in ["kvm"]:
1015+
cls.ensure_all_hosts_are_up()
10141016
super(TestSecuredVmMigration, cls).tearDownClass()
10151017

1018+
@classmethod
1019+
def ensure_all_hosts_are_up(cls):
1020+
hosts = Host.list(
1021+
cls.apiclient,
1022+
zoneid=cls.zone.id,
1023+
type='Routing',
1024+
hypervisor='KVM'
1025+
)
1026+
for host in hosts:
1027+
if host.state != "Up":
1028+
SshClient(host.ipaddress, port=22, user=cls.hostConfig["username"], passwd=cls.hostConfig["password"]) \
1029+
.execute("service cloudstack-agent stop ; \
1030+
sleep 10 ; \
1031+
service cloudstack-agent start")
1032+
interval = 5
1033+
retries = 10
1034+
while retries > -1:
1035+
time.sleep(interval)
1036+
restarted_host = Host.list(
1037+
cls.apiclient,
1038+
hostid=host.id,
1039+
type='Routing'
1040+
)[0]
1041+
if restarted_host.state == "Up":
1042+
break
1043+
retries = retries - 1
1044+
10161045
def setUp(self):
10171046
self.apiclient = self.testClient.getApiClient()
10181047
self.dbclient = self.testClient.getDbConnection()

0 commit comments

Comments
 (0)