Skip to content

CloudStack DNS framework - Integrate PowerDNS as first plugin#12737

Draft
sudo87 wants to merge 69 commits into
apache:mainfrom
shapeblue:dnsProviderFramework
Draft

CloudStack DNS framework - Integrate PowerDNS as first plugin#12737
sudo87 wants to merge 69 commits into
apache:mainfrom
shapeblue:dnsProviderFramework

Conversation

@sudo87

@sudo87 sudo87 commented Mar 3, 2026

Copy link
Copy Markdown
Contributor

Description

This PR introduces initial implementation for a plugin based DNS framework in Apache CloudStack. It enables both admin and end-users to manage DNS zones and record with external authoritative dns providers.

First supported DNS provider: PowerDNS

Github issue: #9958
Cwiki: https://cwiki.apache.org/confluence/display/CLOUDSTACK/DNS+Framework+and+Plugins
Doc PR: apache/cloudstack-documentation#646

Untitled Diagram drawio

Terminology:

  1. DNS Server: integration between CloudStack and DNS provider
  2. DNS Zone: Domain scope
  3. DNS Record: mapping entry with dns zones (e.g. mapping between names and ip)

API Changes

There are following APIs have been introduced to support DNS management from CloudStack and Instance auto registration:

  • [add/update/delete]DnsServer
  • [create/update/delete]DnsZone
  • [create/delete]DnsRecord
  • [associate/disassociate]DnsZoneToNetwork

UI changes
Screenshot 2026-04-27 at 4 38 42 PM
Screenshot 2026-04-27 at 4 38 49 PM
Screenshot 2026-04-27 at 4 38 57 PM
Screenshot 2026-04-27 at 4 39 21 PM

  • DNS Server subsection under Network
  • DNS Zone subsection under Network
  • DNS records management tab in the Dns Zone

Supported network for Auto Registration: Shared network

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • Build/CI
  • Test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

How did you try to break this feature and the system with this change?

sudo87 added 22 commits February 9, 2026 10:52
2. added relevant changes in dao and vo
3. worked on creatednszone, integration with mgr
4. powerdns create zone api call
1. creatednszone
2. listdnszone
3. updatednszone
4. deletednszone
1. Add dns server
2. create zone
3. add records
4. verify in powerdns
5. verify using dig
1. Registerdnsrecordforvm api
2. removednsrecordforvm api
3. cleanup; fixed license, dao logic
1. refactored client
2. added exceptions
3. enhanced updateZone
4. ownership check for deleteDnsServer
1. port for dns_server
2. remove hard coded localhost for server_id
3. resolve and store server id if not passed in the api request
4. restrict public dns_server for domain admins and admins
…elete events

2. add dnsrecordurl in nic_details table
3. add dnsrecordurl in vm response
@codecov

codecov Bot commented Mar 3, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 74.11538% with 673 lines in your changes missing coverage. Please review.
✅ Project coverage is 19.14%. Comparing base (8ef036e) to head (0c6370a).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
.../apache/cloudstack/dns/DnsProviderManagerImpl.java 77.90% 125 Missing and 54 partials ⚠️
...g/apache/cloudstack/dns/dao/NicDnsJoinDaoImpl.java 0.00% 56 Missing ⚠️
...ava/org/apache/cloudstack/dns/DnsProviderUtil.java 60.29% 37 Missing and 17 partials ⚠️
...apache/cloudstack/dns/powerdns/PowerDnsClient.java 79.43% 23 Missing and 28 partials ⚠️
...rg/apache/cloudstack/dns/dao/DnsServerDaoImpl.java 56.86% 43 Missing and 1 partial ⚠️
...rg/apache/cloudstack/dns/vo/DnsServerDetailVO.java 0.00% 37 Missing ⚠️
...ava/org/apache/cloudstack/dns/vo/NicDnsJoinVO.java 0.00% 33 Missing ⚠️
.../src/main/java/com/cloud/vm/UserVmManagerImpl.java 48.07% 26 Missing and 1 partial ⚠️
...n/java/org/apache/cloudstack/dns/vo/DnsZoneVO.java 53.57% 24 Missing and 2 partials ⚠️
...pache/cloudstack/api/response/DnsZoneResponse.java 55.81% 18 Missing and 1 partial ⚠️
... and 35 more
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #12737      +/-   ##
============================================
+ Coverage     18.88%   19.14%   +0.25%     
- Complexity    18222    18607     +385     
============================================
  Files          6178     6235      +57     
  Lines        555397   558566    +3169     
  Branches      67797    68194     +397     
============================================
+ Hits         104871   106918    +2047     
- Misses       439005   439995     +990     
- Partials      11521    11653     +132     
Flag Coverage Δ
uitests 3.48% <ø> (-0.04%) ⬇️
unittests 20.37% <74.11%> (+0.28%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@winterhazel winterhazel added this to the 4.23.0 milestone Mar 3, 2026
@github-actions

github-actions Bot commented Mar 9, 2026

Copy link
Copy Markdown

This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.

@blueorangutan

Copy link
Copy Markdown

[SF] Trillian test result (tid-16269)
Environment: kvm-ol8 (x2), zone: Advanced Networking with Mgmt server ol8
Total time taken: 53887 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr12737-t16269-kvm-ol8.zip
Smoke tests completed. 149 look OK, 3 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
ContextSuite context=TestClusterDRS>:setup Error 0.00 test_cluster_drs.py
ContextSuite context=TestCloudStackDNSFramework>:setup Error 0.00 test_dns_framework_powerdns.py
test_01_redundant_vpc_site2site_vpn Failure 412.00 test_vpc_vpn.py

@sudo87

sudo87 commented Jun 10, 2026

Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@sudo87 a [SL] Jenkins job has been kicked to build packages. It will be bundled with no SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 18211

@blueorangutan

Copy link
Copy Markdown

[SF] Trillian test result (tid-16275)
Environment: kvm-ol8 (x2), zone: Advanced Networking with Mgmt server ol8
Total time taken: 4491 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr12737-t16275-kvm-ol8.zip
Smoke tests completed. 10 look OK, 142 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
runTest Error 0.00 test_2fa.py
runTest Error 0.00 test_account_access.py
runTest Error 0.00 test_accounts.py
runTest Error 0.00 test_affinity_groups_projects.py
runTest Error 0.00 test_affinity_groups.py
runTest Error 0.00 test_annotations.py
runTest Error 0.00 test_async_job.py
runTest Error 0.00 test_attach_multiple_volumes.py
runTest Error 0.00 test_backup_recovery_dummy.py
runTest Error 0.00 test_backup_recovery_nas.py
runTest Error 0.00 test_backup_recovery_veeam.py
runTest Error 0.00 test_certauthority_root.py
runTest Error 0.00 test_cluster_drs.py
runTest Error 0.00 test_console_endpoint.py
runTest Error 0.00 test_create_list_domain_account_project.py
runTest Error 0.00 test_create_network.py
runTest Error 0.00 test_deploy_vgpu_enabled_vm.py
runTest Error 0.00 test_deploy_virtio_scsi_vm.py
runTest Error 0.00 test_deploy_vm_extra_config_data.py
runTest Error 0.00 test_deploy_vm_iso.py
runTest Error 0.00 test_deploy_vm_iso_uefi.py
runTest Error 0.00 test_deploy_vm_root_resize.py
runTest Error 0.00 test_deploy_vms_in_parallel.py
runTest Error 0.00 test_deploy_vms_with_varied_deploymentplanners.py
runTest Error 0.00 test_deploy_vm_with_userdata.py
runTest Error 0.00 test_diagnostics.py
runTest Error 0.00 test_direct_download.py
runTest Error 0.00 test_disk_offerings.py
runTest Error 0.00 test_disk_provisioning_types.py
runTest Error 0.00 test_domain_disk_offerings.py
runTest Error 0.00 test_domain_network_offerings.py
runTest Error 0.00 test_domain_service_offerings.py
runTest Error 0.00 test_domain_vpc_offerings.py
runTest Error 0.00 test_enable_account_settings_for_domain.py
runTest Error 0.00 test_events_resource.py
runTest Error 0.00 test_extension_custom_action_lifecycle.py
runTest Error 0.00 test_extension_custom.py
runTest Error 0.00 test_extension_lifecycle.py
runTest Error 0.00 test_gateway_on_shared_networks.py
runTest Error 0.00 test_global_acls.py
runTest Error 0.00 test_global_settings.py
runTest Error 0.00 test_guest_os.py
runTest Error 0.00 test_guest_vlan_range.py
runTest Error 0.00 test_host_control_state.py
runTest Error 0.00 test_hostha_simulator.py
runTest Error 0.00 test_host_ping.py
runTest Error 0.00 test_image_store_object_migration.py
runTest Error 0.00 test_import_unmanage_volumes.py
runTest Error 0.00 test_internal_lb.py
runTest Error 0.00 test_ipv4_routing.py
runTest Error 0.00 test_ipv6_infra.py
runTest Error 0.00 test_iso.py
runTest Error 0.00 test_kubernetes_clusters.py
runTest Error 0.00 test_kubernetes_supported_versions.py
runTest Error 0.00 test_list_accounts.py
runTest Error 0.00 test_list_disk_offerings.py
runTest Error 0.00 test_list_domains.py
runTest Error 0.00 test_list_hosts.py
runTest Error 0.00 test_list_ids_parameter.py
runTest Error 0.00 test_list_service_offerings.py
runTest Error 0.00 test_list_storage_pools.py
runTest Error 0.00 test_list_volumes.py
runTest Error 0.00 test_loadbalance.py
runTest Error 0.00 test_login.py
runTest Error 0.00 test_metrics_api.py
runTest Error 0.00 test_migration.py
runTest Error 0.00 test_ms_maintenance_and_safe_shutdown.py
runTest Error 0.00 test_multipleips_per_nic.py
runTest Error 0.00 test_nested_virtualization.py
runTest Error 0.00 test_network_acl.py
runTest Error 0.00 test_network_ipv6.py
runTest Error 0.00 test_network_permissions.py
runTest Error 0.00 test_network.py
runTest Error 0.00 test_projects.py
runTest Error 0.00 test_nic_adapter_type.py
runTest Error 0.00 test_nic.py
runTest Error 0.00 test_non_contigiousvlan.py
runTest Error 0.00 test_nonstrict_affinity_group.py
runTest Error 0.00 test_outofbandmanagement_nestedplugin.py
runTest Error 0.00 test_outofbandmanagement.py
runTest Error 0.00 test_over_provisioning.py
runTest Error 0.00 test_password_server.py
runTest Error 0.00 test_persistent_network.py
runTest Error 0.00 test_portable_publicip.py
runTest Error 0.00 test_portforwardingrules.py
runTest Error 0.00 test_primary_storage.py
runTest Error 0.00 test_primary_storage_scope.py
runTest Error 0.00 test_privategw_acl_ovs_gre.py
runTest Error 0.00 test_privategw_acl.py
runTest Error 0.00 test_public_ip_range.py
runTest Error 0.00 test_purge_expunged_vms.py
runTest Error 0.00 test_pvlan.py
runTest Error 0.00 test_quarantined_ips.py
runTest Error 0.00 test_regions.py
runTest Error 0.00 test_register_userdata.py
runTest Error 0.00 test_reset_configuration_settings.py
runTest Error 0.00 test_reset_vm_on_reboot.py
runTest Error 0.00 test_resource_accounting.py
runTest Error 0.00 test_resource_detail.py
runTest Error 0.00 test_resource_names.py
runTest Error 0.00 test_restore_vm.py
runTest Error 0.00 test_router_dhcphosts.py
runTest Error 0.00 test_router_dns.py
runTest Error 0.00 test_router_dnsservice.py
runTest Error 0.00 test_routers_iptables_default_policy.py
runTest Error 0.00 test_routers_network_ops.py
runTest Error 0.00 test_routers.py
runTest Error 0.00 test_scale_vm.py
runTest Error 0.00 test_secondary_storage.py
runTest Error 0.00 test_service_offerings.py
runTest Error 0.00 test_set_sourcenat.py
runTest Error 0.00 test_sharedfs_lifecycle.py
runTest Error 0.00 test_snapshots.py
runTest Error 0.00 test_ssl_offloading.py
runTest Error 0.00 test_ssvm.py
runTest Error 0.00 test_vm_autoscaling.py
runTest Error 0.00 test_storage_policy.py
runTest Error 0.00 test_systemvm_userdata.py
runTest Error 0.00 test_templates.py
runTest Error 0.00 test_update_security_group.py
runTest Error 0.00 test_usage_events.py
runTest Error 0.00 test_usage.py
runTest Error 0.00 test_vm_deployment_planner.py
runTest Error 0.00 test_vm_life_cycle.py
runTest Error 0.00 test_vm_lifecycle_unmanage_import.py
runTest Error 0.00 test_vm_lifecycle_unmanage_kvm_import.py
runTest Error 0.00 test_vm_lifecycle_with_snapshot_or_volume.py
runTest Error 0.00 test_vm_schedule.py
runTest Error 0.00 test_vm_snapshot_kvm.py
runTest Error 0.00 test_vm_snapshots.py
runTest Error 0.00 test_vm_strict_host_tags.py
runTest Error 0.00 test_vnf_templates.py
runTest Error 0.00 test_volumes.py
runTest Error 0.00 test_vpc_conserve_mode.py
runTest Error 0.00 test_vpc_ipv6.py
runTest Error 0.00 test_vpc_redundant.py
runTest Error 0.00 test_vpc_router_nics.py
runTest Error 0.00 test_vpc_vpn.py
runTest Error 0.00 test_webhook_delivery.py
runTest Error 0.00 test_webhook_lifecycle.py
runTest Error 0.00 test_host_maintenance.py
runTest Error 0.00 test_hostha_kvm.py

@vladimirpetrov

Copy link
Copy Markdown
Contributor

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

@vladimirpetrov a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

@apache apache deleted a comment from blueorangutan Jun 11, 2026
@blueorangutan

Copy link
Copy Markdown

[SF] Trillian test result (tid-16278)
Environment: kvm-ol8 (x2), zone: Advanced Networking with Mgmt server ol8
Total time taken: 51112 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr12737-t16278-kvm-ol8.zip
Smoke tests completed. 150 look OK, 2 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
ContextSuite context=TestCloudStackDNSFramework>:setup Error 0.00 test_dns_framework_powerdns.py
test_02_ssl_offloading_project_vpc Failure 853.91 test_ssl_offloading.py

@github-actions

Copy link
Copy Markdown

This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.

@github-actions

Copy link
Copy Markdown

This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.

Copilot AI review requested due to automatic review settings June 23, 2026 11:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 130 out of 131 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (6)

server/src/main/java/com/cloud/api/ApiDBUtils.java:1

  • dnsZoneVO can be null if the referenced DNS zone was deleted/soft-deleted or the lookup fails, which will cause a NullPointerException at dnsZoneVO.getName(). Add an explicit null-check for dnsZoneVO before dereferencing (and return (null, null) or a partial pair as appropriate).
    server/src/main/java/com/cloud/api/ApiResponseHelper.java:1
  • This adds at least one extra DB lookup per network response, which can become an N+1 query pattern when listing many networks. Consider fetching DNS zone/subdomain via an existing network join/view (or batch-loading mappings for the set of network IDs) to avoid per-row lookups.
    ui/src/components/view/ListView.vue:1
  • This template uses v-if (not v-else-if) and will render in addition to other v-if templates that may also match for the same column, resulting in duplicated cell content. Make this a true fallback (e.g., convert to v-else/v-else-if in the same chain), or narrow the condition to only keys that have no specialized template.
    server/src/main/java/org/apache/cloudstack/dns/dao/DnsZoneNetworkMapDao.java:1
  • The findByZoneId method takes a parameter named networkId, which is misleading and increases the chance of accidentally passing the wrong ID type. Rename the parameter to dnsZoneId (and keep naming consistent across DAO interfaces/impls) to reduce misuse.
    server/src/main/java/org/apache/cloudstack/dns/vo/DnsZoneVO.java:1
  • getAssociatedNetworks() currently always returns an empty list, which will incorrectly report 'no associations' even when dns_zone_network_map contains mappings. Prefer populating this via a transient field set by the manager/query layer, or implement retrieval via the mapping DAO so callers can rely on this contract.
    engine/schema/src/main/resources/META-INF/db/schema-42210to42300.sql:1
  • The unique constraint name uc_dns_zone__uuid is reused for dns_zone_network_map, even though it’s a different table. While this may work (depending on DB/index naming rules), it’s confusing for maintenance and troubleshooting. Consider renaming it to something table-specific (e.g., uc_dns_zone_network_map__uuid).

@weizhouapache

Copy link
Copy Markdown
Member

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@weizhouapache a [SL] Jenkins job has been kicked to build packages. It will be bundled with no SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 18349

@DaanHoogland

Copy link
Copy Markdown
Contributor

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DNS Provider for CloudStack

7 participants