cloudstack icon indicating copy to clipboard operation
cloudstack copied to clipboard

Remove nic host with id: null

Open poli1025 opened this issue 3 weeks ago • 6 comments

problem

The issue we are experiencing is that when attempting to remove a network interface in KVM while the VM is powered off, the operation fails with the following error: 'Host with id: null not found.' When the VM is running, the interface can be removed without any problems.

Image

versions

ACS: 4.20.0 SO: Ubuntu 24.0.4

Steps to reproduce the issue:

  1. Power off the VM in KVM.
  2. Attempt to remove a network interface from the VM configuration.
  3. The operation fails and the following error is returned: "Host with id: null not found".
  4. If the same action is performed while the VM is running, the network interface can be removed successfully.

poli1025 avatar Dec 10 '25 14:12 poli1025

this seems to be related to #2482 cc @nvazquez

weizhouapache avatar Dec 10 '25 14:12 weizhouapache

@weizhouapache Why is this related to #2482?

poli1025 avatar Dec 10 '25 15:12 poli1025

@weizhouapache Why is this related to #2482?

@poli1025 the error is thrown by this line

https://github.com/apache/cloudstack/blob/cfe96026dc424e19e9d9ccf941955b8cb41c6717/server/src/main/java/com/cloud/hypervisor/KVMGuru.java#L133-L139

you have enabled CPU cap in the service offering, right ?

weizhouapache avatar Dec 10 '25 16:12 weizhouapache

@weizhouapache Why is this related to #2482?

@poli1025 the error is thrown by this line

cloudstack/server/src/main/java/com/cloud/hypervisor/KVMGuru.java

Lines 133 to 139 in cfe9602

if (to.isLimitCpuUse()) { VirtualMachine vm = vmProfile.getVirtualMachine(); HostVO host = hostDao.findById(vm.getHostId()); if (host == null) { throw new CloudRuntimeException("Host with id: " + vm.getHostId() + " not found"); } logger.debug("Limiting CPU usage for VM: {} on host: {}", vm, host); you have enabled CPU cap in the service offering, right ?

Yes, I have CPU capping enabled. So, if I disable the CPU cap in the service offering, it should work, right?"

poli1025 avatar Dec 10 '25 16:12 poli1025

Yes, I have CPU capping enabled. So, if I disable the CPU cap in the service offering, it should work, right?"

Yes @poli1025 Please have a try

weizhouapache avatar Dec 10 '25 19:12 weizhouapache

Yes @poli1025 Please have a try

I tested with CPU CAP disabled and it works correctly.

poli1025 avatar Dec 11 '25 08:12 poli1025