-
Notifications
You must be signed in to change notification settings - Fork 1.3k
ConfigDrive: use file absolute path instead of canonical path to create ISO #11623
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ConfigDrive: use file absolute path instead of canonical path to create ISO #11623
Conversation
|
@blueorangutan package |
|
@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 Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 14976 |
|
@blueorangutan test ol9 kvm-ol9 |
There was a problem hiding this 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.
vishesh92
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clgtm
|
@blueorangutan test ol9 kvm-ol9 keepEnv |
|
@weizhouapache a [SL] Trillian-Jenkins test job (ol9 mgmt + kvm-ol9) has been kicked to run smoke tests |
|
[SF] Trillian test result (tid-14309)
|
|
[SF] Trillian test result (tid-14316)
|
|
@blueorangutan package |
|
@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. |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 15001 |
|
@blueorangutan test |
|
@weizhouapache a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
|
@blueorangutan test ol9 kvm-ol9 |
|
@weizhouapache a [SL] Trillian-Jenkins test job (ol9 mgmt + kvm-ol9) has been kicked to run smoke tests |
|
@blueorangutan test ubuntu24 kvm-ubuntu24 |
|
@weizhouapache a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
problem statement says: “On RHEL 9.6” so let’s keep it on 20 |
|
@blueorangutan test ol9 kvm-ol9 |
|
@weizhouapache a [SL] Trillian-Jenkins test job (ol9 mgmt + kvm-ol9) has been kicked to run smoke tests |
|
[SF] Trillian test result (tid-14904)
|
|
[SF] Trillian test result (tid-14906)
|
harikrishna-patnala
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code LGTM
|
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch. |
|
@blueorangutan package |
|
@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. |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 16414 |
|
@blueorangutan test |
|
@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
|
[SF] Trillian test result (tid-15209)
|
There was a problem hiding this 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/xorrisofs → xorriso |
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:
- Verify kvm1 has symlink chain:
/usr/bin/genisoimage→/etc/alternatives/mkisofs-genisoimage→/usr/bin/xorrisofs→xorriso - Deploy VM with userdata on kvm1 using L2 network with ConfigDrive provider
- Verify VM reaches Running state
- Check management server logs for ISO creation command path
Expected Result:
- VM deploys successfully with state "Running"
- ConfigDrive ISO is created using
/usr/bin/genisoimagepath (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:
- 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.
- 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"
}
}- 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 ].
- 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
- 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:
- Verify kvm2 has real genisoimage binary (not symlink)
- Deploy VM with userdata on kvm2 using L2 network with ConfigDrive provider
- Verify VM reaches Running state
- Check management server logs for ISO creation
- 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:
- 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
- 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"
}
}- 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.
- 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
- 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:
- Verify ConfigDrive ISO files exist on secondary storage
- Mount and verify ISO contents on kvm1 (xorriso symlink setup)
- Mount and verify ISO contents on kvm2 (real genisoimage)
- 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:
- 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
- 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
- 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
- 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'/>
- 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'/>
* 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)
Description
This PR fixes #11622
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
How did you try to break this feature and the system with this change?