Copilot commented on code in PR #14493:
URL: https://github.com/apache/cloudstack/pull/14493#discussion_r4512278852


##########
test/integration/smoke/test_scale_vm.py:
##########
@@ -182,8 +171,50 @@ def get_ssh_client(self, ip, username, password, 
retries=10):
 
         return ssh_client
 
-    def is_host_xcpng8(self, hostname):
-        return type(hostname) == list and len(hostname) > 0 and 'XCP-ng 8' in 
hostname[0]
+    def wait_for_xen_pv_tools(self, vm, timeout=60, interval=10):
+        """XenServer only: wait until the guest PV tools are detected.
+        XenServer refuses a live vCPU change (VmLacksFeature) until then."""
+        if self.hypervisor.lower() != "xenserver":
+            return
+        vm_info = VirtualMachine.list(self.apiclient, id=vm.id)[0]
+        instance_name = vm_info.instancename
+        host = Host.list(
+            self.apiclient,
+            zoneid=self.zone.id,
+            hostid=vm_info.hostid,

Review Comment:
   `listHosts` filters by `id`, not `hostid`, so this query can select a host 
from a different XenServer pool. The helper then polls a pool that does not 
contain the VM and times out even when its guest tools are running. Use 
`id=vm_info.hostid`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to