vmsiul
Enthusiast
Enthusiast

vRA8.6 - Cloud-init not working with Ubuntu 20.04

Hello, 

I apologize if this has been asked and resolved before. I am trying to get Cloud-init to work with vRA8.6 in order to execute a hostname change for a Ubuntu 20.04 image. But I am unable to get this work, I have seen many different post from different people reporting this issue. One blog seems to report this a known issue and there is some "workaround" in place but the blog post has some age and I was wondering if there is a fix or someone is aware of something else?

https://vmwarelab.org/2020/02/14/vsphere-customization-with-cloud-init-while-using-vrealize-automati...

Thanks.

0 Kudos
6 Replies
bdamian
Expert
Expert

Are you using static or dynamic IP?

---
Damián Bacalov
vExpert 2017-2018-2019-2020-2021-2022
https://www.linkedin.com/in/damianbacalov/
https://tecnologiaimasd.blogspot.com/
twitter @bdamian
Tags (1)
0 Kudos
vmsiul
Enthusiast
Enthusiast

Hi Damián, 

Dynamic IP, I want to use cloud-init for setting a hostname for Ubuntu 20.04 but nothing cloud-init works, ie create a folder, etc. No issues with CentOS. 

0 Kudos
bdamian
Expert
Expert

I'm using Cloud-Init with Ubuntu 20.04 without problems. Are you using an Ubuntu Cloud Image or VM template?

---
Damián Bacalov
vExpert 2017-2018-2019-2020-2021-2022
https://www.linkedin.com/in/damianbacalov/
https://tecnologiaimasd.blogspot.com/
twitter @bdamian
0 Kudos
vmsiul
Enthusiast
Enthusiast

Ok, good to know. I am using a VM Template with Ubuntu 20.04 LST. I was able to deploy by using 

sudo apt update
sudo apt install cloud-init

and I verified that it's install and running using 

dpkg --get-selections | grep cloud-init

Blueprint is simple, I've tried different other runcmd commands just in case the set hostname was the issue but nothing works. Any suggestions? 

vmsiul_1-1650563217497.png

Thanks

 

0 Kudos
vmsiul
Enthusiast
Enthusiast

Just to update with a little more info hopefully someone points me in the right direction....

When Ubuntu boots I see the following:

vmsiul_0-1650570250053.png

I've tried the following, which is exactly the issue I am running into. I've updated the file to include datastore OVF and didn't work and also deleted the .cfg file and same issue.  

https://stackoverflow.com/questions/64486060/cloud-init-not-executing-vra-cloud-config-script

Another similar issue:

https://communities.vmware.com/t5/vRealize-Automation-Tools/Cloud-init-config-not-running-on-deploym...

90_dpkg.cfg is set to OVF 

vmsiul_0-1650571474787.png

 

Thanks!

ronaldod
Enthusiast
Enthusiast

Did you checked if your cloud config is following the yaml rules ?

Looks i see more then 2 spaces after the runcmd.

Its know for erroring out on yaml mistakes.

 

 

 

0 Kudos