Bug 1954851

Summary: Cloud init user data in template not applied to vm
Product: Container Native Virtualization (CNV) Reporter: joherr
Component: User ExperienceAssignee: Tal Nisan <tnisan>
Status: CLOSED DUPLICATE QA Contact: Oded Ramraz <oramraz>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 2.6.1CC: cnv-qe-bugs, yzamir
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-05-19 16:36:16 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description joherr 2021-04-28 21:59:39 UTC
Description of problem:
When creating a VM from a template with custom cloud-init script, the gui does not show the userData stored in the templates yaml for the cloudinitdisk.
As a result, the VM is created without a known password and the cloud-init scripts are not run.


Version-Release number of selected component (if applicable):
2.5.3

How reproducible:
Everytime


Steps to Reproduce:
1.Create a template from a boot source image (rhel8)
2.Add some custom cloud-init configuration to the template. i used the following:
#cloud-config
user: cloud-user
password: changeme
chpasswd:
  expire: false
rh_subscription:
  org: an_org_name_or_number
  activation-key: an_activation_key
  auto-attach: true

3. Save the template
4. View the yaml for the template and the script is present.
          volumes:
            - name: cloudinitdisk
              cloudInitNoCloud:
                userData: |+
                  #cloud-config
                  user: cloud-user
                  password: changeme
                  chpasswd:
                    expire: false
                  rh_subscription:
                    org: an_org_name_or_number
                    activation-key: an_activation_key
                    auto-attach: true

5. Create a VM from the template.
6. The cloud-init page has a blank custom script.
7. Finish creating the VM with the blank cloud-init script.

Actual results:
The cloud-init script stored in yaml file is not executed. If I create another VM and paste the same script into the gui, it works as expected.


Expected results:
The Custom Cloud-init script stored in the template should automatically populate the gui and be executed once the VM is created.


Additional info:

Comment 1 joherr 2021-05-03 17:40:21 UTC
I tested creating the VM from the command line and it works as expected. The cloud-init stored in the template is executed.

oc process rhel8-autoregister -n default NAME=test-cloud-init | oc create -f -

Comment 2 joherr 2021-05-04 14:52:20 UTC
I am running OpenShift version 4.7.3 and CNV version 2.6.1.

Comment 3 Yaacov Zamir 2021-05-19 16:36:16 UTC

*** This bug has been marked as a duplicate of bug 1925207 ***