Blueprint which works & updates the
cloudConfig even after Create phase is shown below:
formatVersion: 1
inputs: {}
resources:
vSphere_VM:
type: Cloud.vSphere.Machine
properties:
name: ${replace(env.projectName, " ", "-")}
imageRef: https://cloud-images.ubuntu.com/releases/22.04/release/ubuntu-22.04-server-cloudimg-amd64.ova
cpuCount: 2
totalMemoryMB: 2048
cloudConfigSettings:
deploymentFailOnCloudConfigRuntimeError: true
customCloudConfig: |
runcmd:
- echo Hallo
cloudConfig: |
ssh_pwauth: true
chpasswd:
expire: false
users:formatVersion: 1
inputs: {}
resources:
vSphere_VM:
type: Cloud.vSphere.Machine
properties:
name: ${replace(env.projectName, " ", "-")}
imageRef: https://cloud-images.ubuntu.com/releases/22.04/release/ubuntu-22.04-server-cloudimg-amd64.ova
cpuCount: 2
totalMemoryMB: 2048
cloudConfigSettings:
deploymentFailOnCloudConfigRuntimeError: true
customCloudConfig: |
runcmd:
- echo Hallo
cloudConfig: |
ssh_pwauth: true
chpasswd:
expire: false
users:
- name: root
password: VMware1!
type: text
runcmd:
- hostnamectl set-hostname ${replace(env.projectName, " ", "-")}
- eject
- name: root
password: VMware1!
type: text
runcmd:
- hostnamectl set-hostname ${replace(env.projectName, " ", "-")}
- eject
Impact/Risks:
The
cloudConfig will be updated in Allocate phase of the resource, but it will go back to the original
cloudConfig after the create phase.