Created cloud config, but can't select it when creating a new VM.
-
Created a cloud config under settings > cloud configs.
When creating a new VM, I'm unable to select the specific cloud config. Opened the advanced settings, and still no choice for selecting a cloud config.
When creating the VM:
Where exactly can I select the cloud config when creating a new VM?
-
Hi,
You can only select Cloud Config if you have a VM template with existing disks. Cloud init will only work on a system with Cloudinit already configured and installed, not on a fresh VM without empty disks.
Please read our doc about it: https://xen-orchestra.com/docs/advanced.html#cloud-init
-
@olivierlambert Created a VM template and installed cloud init as the link you sent suggested. But the cloud init file is not being read Xen Orchestra or none of the cloud init settings are actually being set on the new VM.
Is there anything that I need to do on the template VM that is not there in the guide? I followed this link for creating the template: https://xen-orchestra.com/blog/centos-cloud-template-for-xenserver/
When I create a new vm, and select a custom cloud init config. It doesn't do anything on the new vm. Here is my custom cloud-init config:
#cloud-config timezone: America/New_York hostname: testing packages: - htop - tree package_update: true package_upgrade: true
The hostname is the same as the template hostname.
-
What OS are you using?
-
@olivierlambert I tried it with Ubuntu 18.04 and installed cloud init when creating the template.
-
So you need to check cloudinit logs in your VM to understand why it doesn't fetch your config.
-
@olivierlambert Seems like the cloud init config that gets run is the one under:
/var/lib/cloud/seed/nocloud-net/user-data
Have checked all the different logs and there is nothing about the custom cloud-init config that I selected during VM creation using XenOrchestra.
-
@olivierlambert - I was trying Debian cloud template for XenServer with Debian 10, the installation process mostly works except 'dpkg-reconfigure cloud-init' does not bring up data source selection window. I also read XO Cloudinit guide which talks about openstack vs nocloud config drive, however I have tried the defaults and cloud config tab, but the VM does not pick up the cloud init settings, not sure if I should start a new topic or not but having similar issue.
-
Please try with our Debian template in XO Hub.
-
@olivierlambert I wish, the community edition does not have hub support I believe.
-
You can try with XOA Free
-
@olivierlambert I will certainly try that, however I wanted to customize it for k8s cluster, so was wondering if the old guide need updating if at all.
-
If we can find exactly why, yes we could improve/fix it
-
@olivierlambert - ok, I will continue troubleshooting, the guide is pretty basic, i.e. install plain vanilla debian and install couldinit so was not sure what could go wrong.
-
Partition ID for Cloudinit is the first step to check.
apt-get install cloud-init cloud-initramfs-growroot
diff /usr/lib/cloud-init/ds-identify.ORIGINAL /usr/lib/cloud-init/ds-identify 236a237,238 > LABEL_FATBOOT=*) label="${line#LABEL_FATBOOT=}"; > labels="${labels}${line#LABEL_FATBOOT=}${delim}";; /etc/cloud/cloud.cfg
ssh_deletekeys: true datasource_list: [ ConfigDrive, None ] datasource: ConfigDrive: dsmode: local
-
@olivierlambert just tried to go through the process again from what the example gave. Included the extra lines you mentioned above for the datasource. But it is still not seeing any of the custom cloud init settings that I configured.
Is the template VM somehow badly configured? Is there anything on here that is outdated: https://xen-orchestra.com/blog/centos-cloud-template-for-xenserver/
I'll continue debugging this issue but would be nice to have a guide on how to make cloud init work. Seems like there is something either missing or not working on the current guide (maybe XO bug?).
Looking at the docs again, seems like the cloud-init config didn't really work:
Hostname is set to: cloudtest
Result (host name is not correct )
-
@eperez539 this guide wont work, this is what I did, installed XOA, created the VM from HUB, modified it and converted again to the template.
-
@geek-baba Thanks, do you happen to have some steps on the additional changes you made to the VM before converting in to the template?
-
@eperez539 just install anything you want, for example I added docker and kubernetes and converted it to template and now when I create new VM it retains everything.
-
@geek-baba oh ok, so are you bypassing cloud init altogether? How do you handle the network config? I was hoping to at least setup network + ssh key and then I could mange with Ansible after that.
Initially tried using Terraform with XO, but this cloud init issue may be the problem why I was having an issue getting them to work together.