Skip to content
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

Cloud-init not running when guest network use UsedData: ConfigDrive #9404

Open
leduyquy opened this issue Jul 17, 2024 · 11 comments
Open

Cloud-init not running when guest network use UsedData: ConfigDrive #9404

leduyquy opened this issue Jul 17, 2024 · 11 comments

Comments

@leduyquy
Copy link

ISSUE TYPE
  • Bug Report
COMPONENT NAME
Cloud-init, Instance 
CLOUDSTACK VERSION
4.19.0.1
CONFIGURATION

Guest Network type L2 or Isolated set UsedData use ConfigDrive

OS / ENVIRONMENT

Ubuntu 22.04 for Managerment Cloudstack
VMware 8

SUMMARY

Cloud-init not apply when UsedData use ConfigDrive

STEPS TO REPRODUCE
Create Network L2 or Create isolated network and set UserData use ConfigDrive
Create instance on network
EXPECTED RESULTS
Cloud-init apply and set user/password, ssh-key, etc
ACTUAL RESULTS
Cloud-init not apply to instance
@shwstppr
Copy link
Contributor

Hi @leduyquy please refer https://docs.cloudstack.apache.org/en/4.19.0.2/adminguide/virtual_machines.html#using-cloud-init if not already.
Check if the datasource is configured in the template

@DaanHoogland DaanHoogland added this to the unplanned milestone Jul 17, 2024
@leduyquy
Copy link
Author

I follow this guide bellow:
https://docs.cloudstack.apache.org/en/latest/adminguide/templates/_cloud_init.html

My config:

/etc/cloud/cloud.cfg.d/99_cloudstack.cfg.

datasource_list: [ ConfigDrive, CloudStack, None ]
datasource:
  CloudStack: {}
  None: {}

Also I try with bellow:

datasource_list: [ ConfigDrive, CloudStack, None ]
datasource:
  ConfigDrive: {}
  None: {}

It not working with ConfigDrive. But with VirtualRouter it working normal

@weizhouapache
Copy link
Member

@leduyquy
this issue may be same as #8129

try with the settings described in https://github.com/apache/cloudstack-documentation/pull/383/files

@leduyquy
Copy link
Author

I also tried with it, But it not working too

/etc/cloud/ds-identify.cfg
policy: enabled

@weizhouapache
Copy link
Member

@leduyquy
I tested the change in the debian 12 systemvm on kvm/vmware before , it looks good. (refer to #7650 )

is there any error with cloud-init in /var/log/cloud-init/ directory ?

@leduyquy
Copy link
Author

I try testing in today,. only password not apply to cloudinit. ssh-key and another it ok

@weizhouapache
Copy link
Member

I try testing in today,. only password not apply to cloudinit. ssh-key and another it ok

that's good news

cloud-init set password only once. You can try

sed -i s/"set_passwords"/"[set_passwords, always]"/g /etc/cloud/cloud.cfg

@leduyquy
Copy link
Author

I have config [set_passwords, always] . But it not working. When i check cloud-init.log I see module-config/config-set-password ran susscessfully. But i try with password pop-up from UI Cloudstack it correct.

But with Userdata use VirtualRouter everything working normal,

@rohityadavcloud
Copy link
Member

rohityadavcloud commented Jul 30, 2024

@leduyquy can you try with CloudStack 4.19.1? Which exact version of VMware 8 are you using?

@leduyquy
Copy link
Author

I try with CloudStack version 4.19.1.1 it not working

Env my testing:
Cloudstack version 4.19.1.1
vSphere Client version 8.0.0.10200
VMware ESXi version: 8.0.0 build 21203435

@weizhouapache
Copy link
Member

@leduyquy

it seems cloud-init does not support password reset if data source is ConfigDrive.
Can you check with cloud-init community ?
(this may be related to canonical/cloud-init#2402)

as a workaround, you can add a script to the image
please refer to https://lists.apache.org/thread/3wwnx2bj8g4lyjzvw5ffq0ddhhcxsq0n

You can also try with a userdata which contains the username/new password.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

5 participants