problem
The DNS framework introduced in 4.23.0.0 (PR #12737) auto-registers VM DNS records on shared networks associated with a DNS zone. The registration hook fires when a VM is deployed and when a NIC is attached/detached, but does not fire when an existing stopped VM is simply started via startVirtualMachine — the record never gets created.
versions
- Apache CloudStack 4.23.0.0 (upgraded from 4.22.1.1), KVM
- Shared network with zone associated via associateDnsZoneToNetwork
- PowerDNS auth 4.9 as provider (API integration)
The steps to reproduce the bug
- Associate a DNS zone with a shared network
- Deploy a VM on it → record created (works)
- Stop the VM, delete the resulting record
- Start the VM with startVirtualMachine
- No DNS record created; nic_dns_view.nic_dns_name stays NULL for that NIC
What to do about it?
Expected
Starting an existing stopped VM on a network with an associated zone should register its A/AAAA record, same as fresh deploy.
Actual
No record. VM starts fine, gets DHCP IP, DNS registration silently skipped.
Root cause (from source, 4.23.0.0)
The subscriber in DnsProviderManagerImpl is wired to vm.lifecycle.state and handles case Running: handleVmCreateEvent(...) for any transition — intent is clearly to cover start of existing VMs. But the publisher UserVmManagerImpl.publishVmLifecycleMessageBus(...) is only called from the fresh-deploy path and the destroy path. A plain start of an existing Stopped VM never publishes, so the subscriber never fires.
Verified workaround
NIC detach + re-attach fires NIC lifecycle events (handleNicPlug) and registers the record correctly — registration logic is healthy, only the start trigger is missing.
Additional observations
- Smoke test test_dns_framework_powerdns.py covers API CRUD only; zero coverage for VM auto-registration (any path) — which is why this ships unnoticed.
- Fix directions: publish VM_LIFECYCLE_STATE from the generic Stopped→Running transition, or subscribe to vm.powerstate.
problem
The DNS framework introduced in 4.23.0.0 (PR #12737) auto-registers VM DNS records on shared networks associated with a DNS zone. The registration hook fires when a VM is deployed and when a NIC is attached/detached, but does not fire when an existing stopped VM is simply started via startVirtualMachine — the record never gets created.
versions
The steps to reproduce the bug
What to do about it?
Expected
Starting an existing stopped VM on a network with an associated zone should register its A/AAAA record, same as fresh deploy.
Actual
No record. VM starts fine, gets DHCP IP, DNS registration silently skipped.
Root cause (from source, 4.23.0.0)
The subscriber in DnsProviderManagerImpl is wired to vm.lifecycle.state and handles case Running: handleVmCreateEvent(...) for any transition — intent is clearly to cover start of existing VMs. But the publisher UserVmManagerImpl.publishVmLifecycleMessageBus(...) is only called from the fresh-deploy path and the destroy path. A plain start of an existing Stopped VM never publishes, so the subscriber never fires.
Verified workaround
NIC detach + re-attach fires NIC lifecycle events (handleNicPlug) and registers the record correctly — registration logic is healthy, only the start trigger is missing.
Additional observations