Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

DNS auto-registration on shared networks fires on VM deploy and NIC attach, but not on start of an existing stopped VM

未关闭
#14,197 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
72/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
java, python

调研方向

Read DnsProviderManagerImpl and UserVmManagerImpl, starting with the vm.lifecycle.state subscriber and publishVmLifecycleMessageBus call paths. Run test_dns_framework_powerdns.py and add coverage for starting an existing stopped VM. Done means a Stopped→Running transition registers the expected A/AAAA record while preserving deploy and NIC lifecycle behavior.

由索引模型根据 Issue 内容生成。

描述

bug
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
  1. Associate a DNS zone with a shared network
  2. Deploy a VM on it → record created (works)
  3. Stop the VM, delete the resulting record
  4. Start the VM with startVirtualMachine
  5. No DNS record created; nic_dns_view.nic_dns_name stays NULL for that NIC

Note: If there is an existing shared network with existing VM nics attached before the DNS framework was installed/configured for auto-registration, existing VM will also not auto register its IP, but new VM does.

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.
主要语言
Java
星标
3.1k
派生
1.4k
平均合并
6 天 20 小时
30 天内合并 PR
27

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

apache/cloudstack 的其他 Issue

查看 apache/cloudstack 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。