Skip to content

Conversation

@weizhouapache
Copy link
Member

Description

This PR fixes #11622

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?

@weizhouapache weizhouapache added this to the 4.20.2 milestone Sep 12, 2025
@weizhouapache
Copy link
Member Author

@blueorangutan package

@blueorangutan
Copy link

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

@codecov
Copy link

codecov bot commented Sep 12, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 16.23%. Comparing base (b394b5b) to head (5437feb).
⚠️ Report is 48 commits behind head on 4.20.

Additional details and impacted files
@@            Coverage Diff            @@
##               4.20   #11623   +/-   ##
=========================================
  Coverage     16.23%   16.23%           
- Complexity    13377    13379    +2     
=========================================
  Files          5657     5657           
  Lines        498865   498865           
  Branches      60545    60545           
=========================================
+ Hits          80991    81010   +19     
+ Misses       408843   408820   -23     
- Partials       9031     9035    +4     
Flag Coverage Δ
uitests 4.00% <ø> (ø)
unittests 17.09% <100.00%> (+<0.01%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 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.

@blueorangutan
Copy link

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

@weizhouapache
Copy link
Member Author

@blueorangutan test ol9 kvm-ol9

@vishesh92 vishesh92 requested a review from Copilot September 12, 2025 09:22
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR addresses issue #11622 by replacing usage of File.getCanonicalPath() with File.getAbsolutePath() in the ConfigDrive ISO creation functionality. This change aims to avoid potential issues with symbolic link resolution that can occur with canonical paths.

Key changes:

  • Updated ConfigDriveBuilder to use absolute paths instead of canonical paths for ISO generation tools
  • Updated corresponding unit tests to verify the new method calls

Reviewed Changes

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

File Description
ConfigDriveBuilder.java Modified getProgramToGenerateIso() method to use getAbsolutePath() instead of getCanonicalPath()
ConfigDriveBuilderTest.java Updated test verification calls to match the new getAbsolutePath() method usage

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Member

@vishesh92 vishesh92 left a comment

Choose a reason for hiding this comment

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

clgtm

@weizhouapache
Copy link
Member Author

@blueorangutan test ol9 kvm-ol9 keepEnv

@blueorangutan
Copy link

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

@weizhouapache weizhouapache marked this pull request as ready for review September 12, 2025 12:54
@blueorangutan
Copy link

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

Test Result Time (s) Test File
test_03_deploy_and_scale_kubernetes_cluster Failure 1.17 test_kubernetes_clusters.py
test_04_autoscale_kubernetes_cluster Failure 27.84 test_kubernetes_clusters.py
test_01_redundant_vpc_site2site_vpn Failure 466.74 test_vpc_vpn.py
test_01_vpc_site2site_vpn Failure 296.60 test_vpc_vpn.py

@blueorangutan
Copy link

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

Test Result Time (s) Test File
test_03_deploy_and_scale_kubernetes_cluster Failure 1.17 test_kubernetes_clusters.py
test_04_autoscale_kubernetes_cluster Failure 29.88 test_kubernetes_clusters.py

@weizhouapache weizhouapache changed the base branch from main to 4.20 September 15, 2025 07:10
@weizhouapache
Copy link
Member Author

@blueorangutan package

@blueorangutan
Copy link

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

@blueorangutan
Copy link

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

@weizhouapache
Copy link
Member Author

@blueorangutan test

@blueorangutan
Copy link

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

@weizhouapache
Copy link
Member Author

@blueorangutan test ol9 kvm-ol9

@blueorangutan
Copy link

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

@weizhouapache
Copy link
Member Author

@blueorangutan test ubuntu24 kvm-ubuntu24

@blueorangutan
Copy link

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

@DaanHoogland
Copy link
Contributor

I just realized that EL10 is supported since 4.22.0. Should we fix it in 4.22 ?

problem statement says: “On RHEL 9.6” so let’s keep it on 20

@weizhouapache
Copy link
Member Author

@blueorangutan test ol9 kvm-ol9

@blueorangutan
Copy link

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

@blueorangutan
Copy link

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

Test Result Time (s) Test File

@blueorangutan
Copy link

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

Test Result Time (s) Test File

@weizhouapache weizhouapache linked an issue Dec 4, 2025 that may be closed by this pull request
Copy link
Contributor

@harikrishna-patnala harikrishna-patnala left a comment

Choose a reason for hiding this comment

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

code LGTM

@github-actions
Copy link

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

@DaanHoogland
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

@DaanHoogland a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

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

@DaanHoogland
Copy link
Contributor

@blueorangutan test

@blueorangutan
Copy link

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

@blueorangutan
Copy link

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

Test Result Time (s) Test File

@DaanHoogland DaanHoogland requested review from vladimirpetrov and removed request for kiranchavala January 20, 2026 13:04
@RosiKyu RosiKyu self-assigned this Jan 26, 2026
Copy link
Collaborator

@RosiKyu RosiKyu left a comment

Choose a reason for hiding this comment

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

LGTM

PR: #11623 - ConfigDrive: use file absolute path instead of canonical path to create ISO
Related Issue: #11622, #10864
Test Environment: CloudStack 4.20 with PR packages, KVM on Oracle Linux 9

Test Summary

Test Case Description Host Result
TC-01 ConfigDrive ISO creation with xorriso symlink chain (bug fix validation) kvm1 PASS
TC-02 ConfigDrive ISO creation with real genisoimage binary (no regression) kvm2 PASS
TC-03 ConfigDrive ISO contents and VM attachment verification Both PASS

Test Environment Configuration

Host genisoimage Setup Purpose
kvm1 /usr/bin/genisoimage/etc/alternatives/mkisofs-genisoimage/usr/bin/xorrisofsxorriso Simulates RHEL 9.6 bug scenario
kvm2 Real binary (-rwxr-xr-x. 587128 bytes, ELF 64-bit) Validates no regression

Key Evidence

Before fix (from issue #10864):

Executing config drive creation command: /usr/bin/xorriso -o ...
xorriso : FAILURE : Not a known command: '-o'

After fix (TC-01 on kvm1 with symlink chain):

Executing config drive creation command: /usr/bin/genisoimage -o /tmp/configdrive16636306100171139833/i-2-4-VM.iso ...
Successfully executed process [25684]

Verification Checklist

  • ISO creation uses /usr/bin/genisoimage (absolute path), not /usr/bin/xorriso (canonical path)
  • ConfigDrive ISO generated successfully on host with xorriso symlink chain
  • ConfigDrive ISO generated successfully on host with real genisoimage binary
  • ISO contains correct directory structure (cloudstack/metadata, cloudstack/userdata, openstack/latest)
  • Userdata content correctly embedded in ISO
  • ISO successfully attached to VMs as cdrom device
  • VMs reach Running state on both hosts

Detailed Test Report

TC1: ConfigDrive ISO Creation with xorriso Symlink Chain (Bug Fix Validation)

Objective: Verify that ConfigDrive ISO generation works correctly on systems where /usr/bin/genisoimage is a symlink chain to xorriso (RHEL 9.6 / OL9 scenario). This validates the fix that changes from getCanonicalPath() to getAbsolutePath().

Test Steps:

  1. Verify kvm1 has symlink chain: /usr/bin/genisoimage/etc/alternatives/mkisofs-genisoimage/usr/bin/xorrisofsxorriso
  2. Deploy VM with userdata on kvm1 using L2 network with ConfigDrive provider
  3. Verify VM reaches Running state
  4. Check management server logs for ISO creation command path

Expected Result:

  • VM deploys successfully with state "Running"
  • ConfigDrive ISO is created using /usr/bin/genisoimage path (symlink), NOT resolved /usr/bin/xorriso
  • No "Cannot create ISO" errors in logs

Actual Result: PASSED

  • VM deployed successfully with state "Running" on kvm1
  • ConfigDrive ISO created using /usr/bin/genisoimage (absolute path preserved, symlink not resolved)
  • ISO successfully saved to secondary storage and attached to VM

Test Evidence:

  1. Symlink chain verification on kvm1:
[root@ref-trl-10713-k-Mol9-rositsa-kyuchukova-kvm1 ~]# ls -la /etc/alternatives/mkisofs-genisoimage
lrwxrwxrwx. 1 root root 18 Jan 26 10:03 /etc/alternatives/mkisofs-genisoimage -> /usr/bin/xorrisofs

[root@ref-trl-10713-k-Mol9-rositsa-kyuchukova-kvm1 ~]# update-alternatives --display mkisofs
mkisofs - status is auto.
 link currently points to /usr/bin/xorrisofs
/usr/bin/xorrisofs - priority 50
 slave mkisofs-mkisofsman: /usr/share/man/man1/xorrisofs.1.gz
 slave mkisofs-genisoimage: /usr/bin/xorrisofs
 slave mkisofs-genisoimageman: /usr/share/man/man1/xorrisofs.1.gz
Current `best' version is /usr/bin/xorrisofs.
  1. VM deployment result:
(localcloud) 🐱 > deploy virtualmachine name="configdrive-test-kvm1" displayname="ConfigDrive Test on KVM1 (xorriso symlink)" templateid="f461f621-c726-4488-93fe-9154764b32f8" serviceofferingid="58cc6108-17cb-4ddc-93fe-3547eb77012a" zoneid="90e7dc5f-48c6-489a-bdf4-2ae8cd2ec3b8" networkids="540b2d4c-088a-4f35-8951-f7d839a122a3" hostid="63ac87a7-1a41-4555-ab2a-7f274d54db2e" userdata="IyEvYmluL2Jhc2gKZWNobyAiQ29uZmlnRHJpdmUgdGVzdCBzdWNjZXNzZnVsIG9uIGt2bTEiID4gL3RtcC91c2VyZGF0YS10ZXN0LnR4dAo="
{
  "virtualmachine": {
    "account": "admin",
    "affinitygroup": [],
    "arch": "x86_64",
    "cpunumber": 1,
    "cpuspeed": 500,
    "created": "2026-01-26T10:12:48+0000",
    "deleteprotection": false,
    "details": {
      "cpuOvercommitRatio": "2.0",
      "rootDiskController": "osdefault"
    },
    "displayname": "ConfigDrive Test on KVM1 (xorriso symlink)",
    "displayvm": true,
    "domain": "ROOT",
    "domainid": "009066b8-fa96-11f0-aff1-1e00da00028a",
    "domainpath": "/",
    "guestosid": "3ea53b75-fa96-11f0-aff1-1e00da00028a",
    "haenable": false,
    "hasannotations": false,
    "hostcontrolstate": "Enabled",
    "hostid": "63ac87a7-1a41-4555-ab2a-7f274d54db2e",
    "hostname": "ref-trl-10713-k-Mol9-rositsa-kyuchukova-kvm1",
    "hypervisor": "KVM",
    "id": "a6fa1261-8578-4b05-a041-6b89becee9af",
    "instancename": "i-2-4-VM",
    "isdynamicallyscalable": false,
    "jobid": "ce5e91d8-c04d-4d59-862d-869eec0dc21c",
    "jobstatus": 0,
    "lastupdated": "2026-01-26T10:12:53+0000",
    "memory": 512,
    "name": "configdrive-test-kvm1",
    "nic": [
      {
        "broadcasturi": "vlan://2302",
        "deviceid": "0",
        "extradhcpoption": [],
        "id": "552b39ae-90ea-4998-95e5-750e2c074bcf",
        "isdefault": true,
        "isolationuri": "vlan://2302",
        "macaddress": "02:01:00:cd:00:01",
        "networkid": "540b2d4c-088a-4f35-8951-f7d839a122a3",
        "networkname": "configdrive-test-network",
        "secondaryip": [],
        "traffictype": "Guest",
        "type": "L2"
      }
    ],
    "osdisplayname": "Ubuntu 24.04 LTS",
    "ostypeid": "3ea53b75-fa96-11f0-aff1-1e00da00028a",
    "passwordenabled": false,
    "pooltype": "NetworkFilesystem",
    "receivedbytes": 0,
    "rootdeviceid": 0,
    "rootdevicetype": "ROOT",
    "securitygroup": [],
    "sentbytes": 0,
    "serviceofferingid": "58cc6108-17cb-4ddc-93fe-3547eb77012a",
    "serviceofferingname": "Small Instance",
    "state": "Running",
    "tags": [],
    "templatedisplaytext": "Ubuntu 24.04",
    "templateformat": "QCOW2",
    "templateid": "f461f621-c726-4488-93fe-9154764b32f8",
    "templatename": "Ubuntu 24.04",
    "templatetype": "USER",
    "userid": "4d856158-fa96-11f0-aff1-1e00da00028a",
    "username": "admin",
    "zoneid": "90e7dc5f-48c6-489a-bdf4-2ae8cd2ec3b8",
    "zonename": "ref-trl-10713-k-Mol9-rositsa-kyuchukova"
  }
}
  1. Management server log - ISO creation command (KEY EVIDENCE):
2026-01-26 10:12:50,310 DEBUG [o.a.c.s.c.ConfigDriveBuilder] (Work-Job-Executor-3:[ctx-4f3b83da, job-35/job-36, ctx-0dedf040]) (logid:ce5e91d8) Executing config drive creation command: /usr/bin/genisoimage -o /tmp/configdrive16636306100171139833/i-2-4-VM.iso -ldots -allow-lowercase -allow-multidot -cache-inodes -l -quiet -J -r -V config-2 /tmp/configdrive16636306100171139833 
2026-01-26 10:12:50,310 DEBUG [o.a.c.s.c.ConfigDriveBuilder] (Work-Job-Executor-3:[ctx-4f3b83da, job-35/job-36, ctx-0dedf040]) (logid:ce5e91d8) Executing command [/usr/bin/genisoimage -o /tmp/configdrive16636306100171139833/i-2-4-VM.iso -ldots -allow-lowercase -allow-multidot -cache-inodes -l -quiet -J -r -V config-2 /tmp/configdrive16636306100171139833 ].
2026-01-26 10:12:50,335 DEBUG [o.a.c.s.c.ConfigDriveBuilder] (Work-Job-Executor-3:[ctx-4f3b83da, job-35/job-36, ctx-0dedf040]) (logid:ce5e91d8) Successfully executed process [25684] for command [/usr/bin/genisoimage -o /tmp/configdrive16636306100171139833/i-2-4-VM.iso -ldots -allow-lowercase -allow-multidot -cache-inodes -l -quiet -J -r -V config-2 /tmp/configdrive16636306100171139833 ].
  1. ConfigDrive ISO saved and attached:
2026-01-26 10:12:50,363 DEBUG [c.c.a.m.ClusteredAgentManagerImpl] (Work-Job-Executor-3:[ctx-4f3b83da, job-35/job-36, ctx-0dedf040]) (logid:ce5e91d8) Wait time setting on com.cloud.agent.api.HandleConfigDriveIsoCommand is 1800 seconds
2026-01-26 10:12:50,366 DEBUG [c.c.a.t.Request] (Work-Job-Executor-3:[ctx-4f3b83da, job-35/job-36, ctx-0dedf040]) (logid:ce5e91d8) Seq 4-3705336593419075643: Sending  { Cmd , MgmtId: 32989006267018, via: 4(s-3-VM), Ver: v1, Flags: 100011, [{"com.cloud.agent.api.HandleConfigDriveIsoCommand":{"isoFile":"configdrive/i-2-4-VM.iso","create":"true","destStore":{"com.cloud.agent.api.to.NfsTO":{"_url":"NFS://10.0.32.4/acs/secondary/ref-trl-10713-k-Mol9-rositsa-kyuchukova/ref-trl-10713-k-Mol9-rositsa-kyuchukova-sec1","_role":"Image"}},"useHostCacheOnUnsupportedPool":"true","preferHostCache":"false","wait":"0","bypassHostMaintenance":"false"}}] }
2026-01-26 10:12:50,779 DEBUG [c.c.a.t.Request] (AgentManager-Handler-11:[]) (logid:) Seq 4-3705336593419075643: Processing:  { Ans: , MgmtId: 32989006267018, via: 4, Ver: v1, Flags: 10, [{"com.cloud.agent.api.HandleConfigDriveIsoAnswer":{"result":"true","details":"Successfully saved config drive at secondary storage","wait":"0","bypassHostMaintenance":"false"}}] }
2026-01-26 10:12:50,780 DEBUG [c.c.a.t.Request] (Work-Job-Executor-3:[ctx-4f3b83da, job-35/job-36, ctx-0dedf040]) (logid:ce5e91d8) Seq 4-3705336593419075643: Received:  { Ans: , MgmtId: 32989006267018, via: 4(s-3-VM), Ver: v1, Flags: 10, { HandleConfigDriveIsoAnswer } }
2026-01-26 10:12:50,780 DEBUG [c.c.a.m.ClusteredAgentManagerImpl] (Work-Job-Executor-3:[ctx-4f3b83da, job-35/job-36, ctx-0dedf040]) (logid:ce5e91d8) Details from executing class com.cloud.agent.api.HandleConfigDriveIsoCommand: Successfully saved config drive at secondary storage
  1. Agent log - ISO attached to VM:
2026-01-26 10:12:52,067 DEBUG [kvm.storage.KVMStoragePoolManager] (AgentRequest-Handler-2:[]) (logid:) Get storage pool by uri: NFS://10.0.32.4/acs/secondary/ref-trl-10713-k-Mol9-rositsa-kyuchukova/ref-trl-10713-k-Mol9-rositsa-kyuchukova-sec1/configdrive
<dir path='/acs/secondary/ref-trl-10713-k-Mol9-rositsa-kyuchukova/ref-trl-10713-k-Mol9-rositsa-kyuchukova-sec1/configdrive'/>
2026-01-26 10:12:52,154 DEBUG [kvm.resource.LibvirtVMDef] (AgentRequest-Handler-2:[]) (logid:) Using device ID [4] to define the label [hdd] for volume [/mnt/6cb0f1bb-0ef2-3fc0-8084-5797fa56150b/i-2-4-VM.iso].
<entry name='product'>CloudStack KVM Hypervisor</entry>
<source file='/mnt/6cb0f1bb-0ef2-3fc0-8084-5797fa56150b/i-2-4-VM.iso'/>
2026-01-26 10:12:53,848 DEBUG [cloud.agent.Agent] (AgentRequest-Handler-2:[]) (logid:) Seq 1-4326270392042782834:  { Ans: , MgmtId: 32989006267018, via: 1, Ver: v1, Flags: 10, [{"com.cloud.agent.api.StartAnswer":{"vm":{"id":"4","name":"i-2-4-VM","state":"Starting","type":"User",...,"result":"true","wait":"0","bypassHostMaintenance":"false"}}] }

TC2: ConfigDrive ISO Creation with Real genisoimage Binary (No Regression)

Objective:
Verify that ConfigDrive ISO generation continues to work correctly on systems with a real genisoimage binary (not a symlink). This validates there is no regression introduced by the fix.

Test Steps:

  1. Verify kvm2 has real genisoimage binary (not symlink)
  2. Deploy VM with userdata on kvm2 using L2 network with ConfigDrive provider
  3. Verify VM reaches Running state
  4. Check management server logs for ISO creation
  5. Check agent logs for ISO attachment

Expected Result:

  • VM deploys successfully with state "Running"
  • ConfigDrive ISO is created using /usr/bin/genisoimage
  • No errors in logs

Actual Result: PASSED

  • VM deployed successfully with state "Running" on kvm2
  • ConfigDrive ISO created successfully using real genisoimage binary
  • ISO saved to secondary storage and attached to VM

Test Evidence:

  1. Real genisoimage binary verification on kvm2:
[root@ref-trl-10713-k-Mol9-rositsa-kyuchukova-kvm2 ~]# ls -la /usr/bin/genisoimage && file /usr/bin/genisoimage
-rwxr-xr-x. 1 root root 587128 Jan 19  2022 /usr/bin/genisoimage
/usr/bin/genisoimage: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=5fc18bcdf70907a2e8b603c6f87c473221991deb, for GNU/Linux 3.2.0, stripped
  1. VM deployment result:
(localcloud) 🐱 > deploy virtualmachine name="configdrive-test-kvm2" displayname="ConfigDrive Test on KVM2 (real genisoimage)" templateid="f461f621-c726-4488-93fe-9154764b32f8" serviceofferingid="58cc6108-17cb-4ddc-93fe-3547eb77012a" zoneid="90e7dc5f-48c6-489a-bdf4-2ae8cd2ec3b8" networkids="540b2d4c-088a-4f35-8951-f7d839a122a3" hostid="7c23b254-63d2-4bb9-962b-4bb3c122f6ae" userdata="IyEvYmluL2Jhc2gKZWNobyAiQ29uZmlnRHJpdmUgdGVzdCBzdWNjZXNzZnVsIG9uIGt2bTIiID4gL3RtcC91c2VyZGF0YS10ZXN0LnR4dAo="
{
  "virtualmachine": {
    "account": "admin",
    "affinitygroup": [],
    "arch": "x86_64",
    "cpunumber": 1,
    "cpuspeed": 500,
    "created": "2026-01-26T10:20:08+0000",
    "deleteprotection": false,
    "details": {
      "cpuOvercommitRatio": "2.0",
      "rootDiskController": "osdefault"
    },
    "displayname": "ConfigDrive Test on KVM2 (real genisoimage)",
    "displayvm": true,
    "domain": "ROOT",
    "domainid": "009066b8-fa96-11f0-aff1-1e00da00028a",
    "domainpath": "/",
    "guestosid": "3ea53b75-fa96-11f0-aff1-1e00da00028a",
    "haenable": false,
    "hasannotations": false,
    "hostcontrolstate": "Enabled",
    "hostid": "7c23b254-63d2-4bb9-962b-4bb3c122f6ae",
    "hostname": "ref-trl-10713-k-Mol9-rositsa-kyuchukova-kvm2",
    "hypervisor": "KVM",
    "id": "1e9ac4d2-7a21-468c-aa73-9c364d987052",
    "instancename": "i-2-5-VM",
    "isdynamicallyscalable": false,
    "jobid": "68f1f1d3-a7e6-43ec-9033-4b7abe91300f",
    "jobstatus": 0,
    "lastupdated": "2026-01-26T10:20:11+0000",
    "memory": 512,
    "name": "configdrive-test-kvm2",
    "nic": [
      {
        "broadcasturi": "vlan://2302",
        "deviceid": "0",
        "extradhcpoption": [],
        "id": "235f874d-fb23-4aaf-a1ce-7fc733ccaa65",
        "isdefault": true,
        "isolationuri": "vlan://2302",
        "macaddress": "02:01:00:cd:00:02",
        "networkid": "540b2d4c-088a-4f35-8951-f7d839a122a3",
        "networkname": "configdrive-test-network",
        "secondaryip": [],
        "traffictype": "Guest",
        "type": "L2"
      }
    ],
    "osdisplayname": "Ubuntu 24.04 LTS",
    "ostypeid": "3ea53b75-fa96-11f0-aff1-1e00da00028a",
    "passwordenabled": false,
    "pooltype": "NetworkFilesystem",
    "receivedbytes": 0,
    "rootdeviceid": 0,
    "rootdevicetype": "ROOT",
    "securitygroup": [],
    "sentbytes": 0,
    "serviceofferingid": "58cc6108-17cb-4ddc-93fe-3547eb77012a",
    "serviceofferingname": "Small Instance",
    "state": "Running",
    "tags": [],
    "templatedisplaytext": "Ubuntu 24.04",
    "templateformat": "QCOW2",
    "templateid": "f461f621-c726-4488-93fe-9154764b32f8",
    "templatename": "Ubuntu 24.04",
    "templatetype": "USER",
    "userid": "4d856158-fa96-11f0-aff1-1e00da00028a",
    "username": "admin",
    "zoneid": "90e7dc5f-48c6-489a-bdf4-2ae8cd2ec3b8",
    "zonename": "ref-trl-10713-k-Mol9-rositsa-kyuchukova"
  }
}
  1. Management server log - ISO creation command:
2026-01-26 10:20:10,102 DEBUG [o.a.c.s.c.ConfigDriveBuilder] (Work-Job-Executor-4:[ctx-f3c13b71, job-37/job-38, ctx-0e790ed7]) (logid:68f1f1d3) Executing command [/usr/bin/genisoimage -o /tmp/configdrive17816050648888468201/i-2-5-VM.iso -ldots -allow-lowercase -allow-multidot -cache-inodes -l -quiet -J -r -V config-2 /tmp/configdrive17816050648888468201 ].
2026-01-26 10:20:10,113 DEBUG [o.a.c.s.c.ConfigDriveBuilder] (Work-Job-Executor-4:[ctx-f3c13b71, job-37/job-38, ctx-0e790ed7]) (logid:68f1f1d3) Successfully executed process [26032] for command [/usr/bin/genisoimage -o /tmp/configdrive17816050648888468201/i-2-5-VM.iso -ldots -allow-lowercase -allow-multidot -cache-inodes -l -quiet -J -r -V config-2 /tmp/configdrive17816050648888468201 ].
2026-01-26 10:20:10,113 DEBUG [o.a.c.s.c.ConfigDriveBuilder] (Work-Job-Executor-4:[ctx-f3c13b71, job-37/job-38, ctx-0e790ed7]) (logid:68f1f1d3) Warning: creating filesystem that does not conform to ISO-9660.
  1. ConfigDrive ISO saved and attached:
2026-01-26 10:20:10,131 DEBUG [c.c.a.m.ClusteredAgentManagerImpl] (Work-Job-Executor-4:[ctx-f3c13b71, job-37/job-38, ctx-0e790ed7]) (logid:68f1f1d3) Wait time setting on com.cloud.agent.api.HandleConfigDriveIsoCommand is 1800 seconds
2026-01-26 10:20:10,133 DEBUG [c.c.a.t.Request] (Work-Job-Executor-4:[ctx-f3c13b71, job-37/job-38, ctx-0e790ed7]) (logid:68f1f1d3) Seq 4-3705336593419075652: Sending  { Cmd , MgmtId: 32989006267018, via: 4(s-3-VM), Ver: v1, Flags: 100011, [{"com.cloud.agent.api.HandleConfigDriveIsoCommand":{"isoFile":"configdrive/i-2-5-VM.iso","create":"true","destStore":{"com.cloud.agent.api.to.NfsTO":{"_url":"NFS://10.0.32.4/acs/secondary/ref-trl-10713-k-Mol9-rositsa-kyuchukova/ref-trl-10713-k-Mol9-rositsa-kyuchukova-sec1","_role":"Image"}},"useHostCacheOnUnsupportedPool":"true","preferHostCache":"false","wait":"0","bypassHostMaintenance":"false"}}] }
2026-01-26 10:20:10,485 DEBUG [c.c.a.t.Request] (AgentManager-Handler-15:[]) (logid:) Seq 4-3705336593419075652: Processing:  { Ans: , MgmtId: 32989006267018, via: 4, Ver: v1, Flags: 10, [{"com.cloud.agent.api.HandleConfigDriveIsoAnswer":{"result":"true","details":"Successfully saved config drive at secondary storage","wait":"0","bypassHostMaintenance":"false"}}] }
2026-01-26 10:20:10,485 DEBUG [c.c.a.t.Request] (Work-Job-Executor-4:[ctx-f3c13b71, job-37/job-38, ctx-0e790ed7]) (logid:68f1f1d3) Seq 4-3705336593419075652: Received:  { Ans: , MgmtId: 32989006267018, via: 4(s-3-VM), Ver: v1, Flags: 10, { HandleConfigDriveIsoAnswer } }
2026-01-26 10:20:10,486 DEBUG [c.c.a.m.ClusteredAgentManagerImpl] (Work-Job-Executor-4:[ctx-f3c13b71, job-37/job-38, ctx-0e790ed7]) (logid:68f1f1d3) Details from executing class com.cloud.agent.api.HandleConfigDriveIsoCommand: Successfully saved config drive at secondary storage
  1. Agent log - ISO attached to VM on kvm2:
2026-01-26 10:20:10,749 DEBUG [cloud.agent.Agent] (AgentRequest-Handler-4:[]) (logid:) Request:Seq 2-6724718668594282698:  { Cmd , MgmtId: 32989006267018, via: 2, Ver: v1, Flags: 100011, [{"com.cloud.agent.api.StartCommand":{"vm":{"id":"5","name":"i-2-5-VM","state":"Starting","type":"User","cpus":"1","minSpeed":"250","maxSpeed":"500","minRam":"(512.00 MB) 536870912","maxRam":"(512.00 MB) 536870912","arch":"x86_64","os":"Ubuntu 24.04 LTS","platformEmulator":"Ubuntu 24.04 LTS","bootArgs":"","enableHA":"false","limitCpuUse":"false","enableDynamicallyScaleVm":"false","params":{"configDriveLocation":"SECONDARY","deployvm":"true","cpuOvercommitRatio":"2.0","rootDiskController":"osdefault"},"uuid":"1e9ac4d2-7a21-468c-aa73-9c364d987052","enterHardwareSetup":"false","disks":[{"data":{"org.apache.cloudstack.storage.to.TemplateObjectTO":{"path":"configdrive/i-2-5-VM.iso","uuid":"1e9ac4d2-7a21-468c-aa73-9c364d987052","id":"0","format":"ISO","accountId":"0","hvm":"false","imageDataStore":{"com.cloud.agent.api.to.NfsTO":{"_url":"NFS://10.0.32.4/acs/secondary/ref-trl-10713-k-Mol9-rositsa-kyuchukova/ref-trl-10713-k-Mol9-rositsa-kyuchukova-sec1","_role":"Image"}},"bootable":"false","directDownload":"false","deployAsIs":"false","followRedirects":"false"}},"diskSeq":"4","path":"configdrive/i-2-5-VM.iso","type":"ISO"},...
2026-01-26 10:20:10,781 DEBUG [kvm.storage.KVMStoragePoolManager] (AgentRequest-Handler-4:[]) (logid:) Get storage pool by uri: NFS://10.0.32.4/acs/secondary/ref-trl-10713-k-Mol9-rositsa-kyuchukova/ref-trl-10713-k-Mol9-rositsa-kyuchukova-sec1/configdrive
<dir path='/acs/secondary/ref-trl-10713-k-Mol9-rositsa-kyuchukova/ref-trl-10713-k-Mol9-rositsa-kyuchukova-sec1/configdrive'/>
2026-01-26 10:20:10,853 DEBUG [kvm.resource.LibvirtVMDef] (AgentRequest-Handler-4:[]) (logid:) Using device ID [4] to define the label [hdd] for volume [/mnt/6cb0f1bb-0ef2-3fc0-8084-5797fa56150b/i-2-5-VM.iso].
<source file='/mnt/6cb0f1bb-0ef2-3fc0-8084-5797fa56150b/i-2-5-VM.iso'/>
2026-01-26 10:20:11,659 DEBUG [cloud.agent.Agent] (AgentRequest-Handler-4:[]) (logid:) Seq 2-6724718668594282698:  { Ans: , MgmtId: 32989006267018, via: 2, Ver: v1, Flags: 10, [{"com.cloud.agent.api.StartAnswer":{"vm":{"id":"5","name":"i-2-5-VM","state":"Starting","type":"User",...,"result":"true","wait":"0","bypassHostMaintenance":"false"}}] }

TC3: Verify ConfigDrive ISO Contents and Attachment to VMs

Objective:
Verify that ConfigDrive ISO files are properly created with correct userdata content and successfully attached to the running VMs on both KVM hosts.

Test Steps:

  1. Verify ConfigDrive ISO files exist on secondary storage
  2. Mount and verify ISO contents on kvm1 (xorriso symlink setup)
  3. Mount and verify ISO contents on kvm2 (real genisoimage)
  4. Verify ISOs are attached to running VMs via libvirt

Expected Result:

  • ConfigDrive ISO files exist for both VMs
  • ISO contains proper directory structure (cloudstack/metadata, cloudstack/userdata, openstack/latest)
  • Userdata script content matches what was provided during VM deployment
  • ISOs are attached as cdrom devices to VMs

Actual Result: PASSED

  • Both ConfigDrive ISO files exist on secondary storage
  • ISO directory structure is correct with all expected metadata and userdata files
  • Userdata content matches deployment parameters
  • ISOs are properly attached to VMs as cdrom devices

Test Evidence:

  1. Verify ConfigDrive ISO files exist on secondary storage (kvm1):
[root@ref-trl-10713-k-Mol9-rositsa-kyuchukova-kvm1 ~]# ls -la /mnt/6cb0f1bb-0ef2-3fc0-8084-5797fa56150b/*.iso
-rw-r--r--. 1 root root 411648 Jan 26 10:12 /mnt/6cb0f1bb-0ef2-3fc0-8084-5797fa56150b/i-2-4-VM.iso
-rw-r--r--. 1 root root 411648 Jan 26 10:20 /mnt/6cb0f1bb-0ef2-3fc0-8084-5797fa56150b/i-2-5-VM.iso
  1. Mount and verify ConfigDrive ISO contents on kvm1:
[root@ref-trl-10713-k-Mol9-rositsa-kyuchukova-kvm1 ~]# mkdir -p /tmp/configdrive-check && mount -o loop /mnt/6cb0f1bb-0ef2-3fc0-8084-5797fa56150b/i-2-4-VM.iso /tmp/configdrive-check && find /tmp/configdrive-check -type f && cat /tmp/configdrive-check/cloudstack/userdata/user_data.txt && umount /tmp/configdrive-check
mount: /tmp/configdrive-check: WARNING: source write-protected, mounted read-only.
/tmp/configdrive-check/cloudstack/metadata/availability-zone.txt
/tmp/configdrive-check/cloudstack/metadata/cloud-identifier.txt
/tmp/configdrive-check/cloudstack/metadata/instance-id.txt
/tmp/configdrive-check/cloudstack/metadata/local-hostname.txt
/tmp/configdrive-check/cloudstack/metadata/service-offering.txt
/tmp/configdrive-check/cloudstack/metadata/vm-id.txt
/tmp/configdrive-check/cloudstack/userdata/user_data.txt
/tmp/configdrive-check/openstack/latest/meta_data.json
/tmp/configdrive-check/openstack/latest/network_data.json
/tmp/configdrive-check/openstack/latest/user_data
/tmp/configdrive-check/openstack/latest/vendor_data.json
#!/bin/bash
echo "ConfigDrive test successful on kvm1" > /tmp/userdata-test.txt
  1. Mount and verify ConfigDrive ISO contents on kvm2:
[root@ref-trl-10713-k-Mol9-rositsa-kyuchukova-kvm2 ~]# mkdir -p /tmp/configdrive-check && mount -o loop /mnt/6cb0f1bb-0ef2-3fc0-8084-5797fa56150b/i-2-5-VM.iso /tmp/configdrive-check && find /tmp/configdrive-check -type f && cat /tmp/configdrive-check/cloudstack/userdata/user_data.txt && umount /tmp/configdrive-check
mount: /tmp/configdrive-check: WARNING: source write-protected, mounted read-only.
/tmp/configdrive-check/cloudstack/metadata/availability-zone.txt
/tmp/configdrive-check/cloudstack/metadata/cloud-identifier.txt
/tmp/configdrive-check/cloudstack/metadata/instance-id.txt
/tmp/configdrive-check/cloudstack/metadata/local-hostname.txt
/tmp/configdrive-check/cloudstack/metadata/service-offering.txt
/tmp/configdrive-check/cloudstack/metadata/vm-id.txt
/tmp/configdrive-check/cloudstack/userdata/user_data.txt
/tmp/configdrive-check/openstack/latest/meta_data.json
/tmp/configdrive-check/openstack/latest/network_data.json
/tmp/configdrive-check/openstack/latest/user_data
/tmp/configdrive-check/openstack/latest/vendor_data.json
#!/bin/bash
echo "ConfigDrive test successful on kvm2" > /tmp/userdata-test.txt
  1. Verify ISO attached to VM on kvm1:
[root@ref-trl-10713-k-Mol9-rositsa-kyuchukova-kvm1 ~]# virsh dumpxml i-2-4-VM | grep -A2 'cdrom'
    <boot dev='cdrom'/>
    <boot dev='hd'/>
    <smbios mode='sysinfo'/>
--
    <disk type='file' device='cdrom'>
      <driver name='qemu'/>
      <target dev='hdc' bus='ide'/>
--
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/mnt/6cb0f1bb-0ef2-3fc0-8084-5797fa56150b/i-2-4-VM.iso' index='1'/>
  1. Verify ISO attached to VM on kvm2:
[root@ref-trl-10713-k-Mol9-rositsa-kyuchukova-kvm2 ~]# virsh dumpxml i-2-5-VM | grep -A2 'cdrom'
    <boot dev='cdrom'/>
    <boot dev='hd'/>
    <smbios mode='sysinfo'/>
--
    <disk type='file' device='cdrom'>
      <driver name='qemu'/>
      <target dev='hdc' bus='ide'/>
--
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/mnt/6cb0f1bb-0ef2-3fc0-8084-5797fa56150b/i-2-5-VM.iso' index='1'/>

@borisstoyanov borisstoyanov merged commit 097c3a0 into apache:4.20 Jan 26, 2026
42 of 43 checks passed
@DaanHoogland DaanHoogland deleted the 4.20-fix-configdrive branch January 26, 2026 11:24
DaanHoogland pushed a commit that referenced this pull request Jan 26, 2026
* 4.22:
  fix install path for systemvm templates when introducing new sec storage (#11605)
  fix Sensitive Data Exposure Through Exception Logging in OVM Hypervis… (#12032)
  Fix snapshot physical size after migration (#12166)
  ConfigDrive: use file absolute path instead of canonical path to create ISO (#11623)
  Add log for null templateVO (#12406)
  snapshot: fix listSnapshots for volume which got delete and whose storage pool got deleted (#12433)
  Notify user if template upgrade is not required (#12483)
  Fix: proper permissions for systemvm template registrations on hardened systems (#12098)
  Allow modification of user vm details if user.vm.readonly.details is empty (#10456)
  NPE fix while deleting storage pool when pool has detached volumes (#12451)
@vladimirpetrov vladimirpetrov removed their request for review January 26, 2026 15:18
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.

4.22.0 EL10 RPM packages require non existent dependency ConfigDrive iso generation not working

9 participants