Bug 1954851 - Cloud init user data in template not applied to vm
Summary: Cloud init user data in template not applied to vm
Keywords:
Status: CLOSED DUPLICATE of bug 1925207
Alias: None
Product: Container Native Virtualization (CNV)
Classification: Red Hat
Component: User Experience
Version: 2.6.1
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: ---
Assignee: Tal Nisan
QA Contact: Oded Ramraz
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-04-28 21:59 UTC by joherr
Modified: 2021-05-19 16:36 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-05-19 16:36:16 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

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 ***


Note You need to log in before you can comment on or make changes to this bug.