/srv/irclogs.ubuntu.com/2020/02/06/#cloud-init.txt

rharperahosmanMSFT: I've run out of time for today; but in general one issue that needs resolving is that the instance.py and image.py both use 'image_id' as a way to reference different things;  that is the instance uses image_id where 'vmName' really ought to be used, but certain places in image.py only have a image_id reference, so when snapshot is run, it needs the image id, but generaize and deallocate etc need the vm_name;  so I think some refactoring00:31
rharperof this needs to happen.  I'll keep working on this tomorrow as well.00:31
ahosmanMSFTrharper: I agree, at first my ideas was having them be interchangeable but seeing how it’s impeding in functionality it needs to be changed.00:34
Xat`hello guys09:45
Xat`I have a per-instance script installed on 2 servers which are part of the same AWS ASG09:45
Xat`when instances first start, the script is run on each instance . But I strictly need to avoid the simultaneity of the execution . Any idea ? I could use a random sleep, but it seems crappy09:48
malasfarHello .. are there any documented steps on how to prepare vSphere templates with cloud-init . we are currently having a issues getting cloud-init to work ?  is this the right channel for such requests?14:27
rharpermalasfar: I'm not aware of any documentation for the templates w.r.t cloud-init upstream;  I suspect there are some vmware knowledge base articles14:33
malasfarany help on this appreciated as there are a lot of misleading information out there including the VMware KBs, i have been trying to get this to work since early 2019 and the results has been always inconsistent depending on what type of IP assignment I use ( Static , DHCP ) . it would be great if someone can jump on a webex/zoom session with me .14:35
malasfarwe just need some insight from the cloud-init team.14:35
rharperXat`:  you need some coordination between two servers so they don't execute the script at the same time?  can the central resource queue/block while ?14:35
rharpermalasfar: to be frank, the vmware datasource with network config is a mess;  there are conflicting modes of operation14:35
rharpercertainly happy to help debug/diagnose; but we've been working with the vmware team to help sort out how to enable all of the various workflows that are available;14:36
malasfari don't disagree .. we are trying to get high visibility on this internally with the BU.. i m a cloud management Staff SE @ vmware14:36
malasfarthat's great to hear . anyone in particular i can reach out to internally on our side. we still dont have a solid way to get this to work and specially for our customers . the only way i personal got it to work if i only used DHCP. and its a hit and mess14:38
rharpermalasfar: on the technical side, if you look through cloud-init git commit history for @vmware.com those are the folks making changes14:39
malasfarthe issue here we provision a machine from vRealize Automation to vSphere . we dont have such issues we provision things to AWS, Azure or GCP14:39
malasfaralright thanks , i will check the git commit history. just want to say that this a huge issue for us at the moment affecting al lot of customers world wide14:41
malasfarit would be great if cloud-init actually worked on vSphere14:42
malasfarthank you for your time14:42
rharpermalasfar: indeed;  sure, stay in touch14:42
amansi26Hi.. I need to change the hostname to the global domain name, right now it is getting assigned to the name to which I deployed the VM. I am using RHEL distro. wherecan I modify that??14:59
amansi26Hi.. I need to change the hostname to the global domain name, right now it is getting assigned to the name to which I deployed the VM. I am using RHEL distro. where can I modify that??17:40
minfrinHey hey. Quick question on cloud-init and swap. Can cloud-init perform the mkswap and swapon steps for a swap partition for us? Struggling to find an example, and my attempts see everything configured (/etc/fstab is correct) but no mkswap or swapon.18:08
blackboxswamansi26: you can provide #cloud-config  user-data to the vm at launch time to do this and set the hostname and/or fqdn fields https://cloudinit.readthedocs.io/en/latest/topics/modules.html#update-hostname18:10
blackboxswamansi26: if  your cloud may provide dynamic hostname and fqdn information from the metadata service, you can check `sudo cloud-init query` to see if any hostname or fqdn values are what you are looking for for the vm, then you could provide a jinja template to source those query parameters from your metadata if needed: https://cloudinit.readthedocs.io/en/latest/topics/instancedata.html#using-instance-data18:13
blackboxswsorry about the run-on sentence18:14
amansi26blackboxsw: I just observed, my resolv.conf is missing with dns server details, that is why failing to set the correct hostname. I just put the dns details and rebooted, hostname comes up. Where is this resolv.conf being handled?18:14
blackboxswamansi26: something like this maybe https://cloudinit.readthedocs.io/en/latest/topics/examples.html#configure-an-instances-resolv-conf18:15
blackboxswor https://cloudinit.readthedocs.io/en/latest/topics/modules.html#resolv-conf18:16
blackboxswminfrin: is this what you are looking for https://cloudinit.readthedocs.io/en/latest/topics/examples.html#adjust-mount-points-mounted?18:18
blackboxswminfrin: from https://cloudinit.readthedocs.io/en/latest/topics/modules.html#mounts18:20
=== hggdh is now known as hggdh-msft
rharperblackboxsw: https://github.com/canonical/cloud-init/pull/205   any idea why this shows CI not complete but if I click through, it shows passed ?21:02
rharperahosmanMSFT: https://github.com/canonical/cloud-init/pull/20521:02
Odd_Blokerharper: Travis was likely having a normal one.  I've tried restarting the fastest of the sub-builds to see if that causes it to attempt to report again.21:31
rharperOdd_Bloke: hehe, thanks for checking21:32
Odd_BlokeIf that doesn't do it, then retrying the whole build is the next step, and that usually works.21:32
rharperok21:32
crimson_kingCan cloud-init be used to override the SSH port configured at /etc/ssh/sshd_config? Because I'm trying to change the SSH server port in my VPS and it's not working (it's always port 22). After talking about this on #ubuntu, they told me it could be cloud-init's fault, since it's being used by my hosting provider to setup the image.21:39
rharpercrimson_king: hrm, lemme check if we support that config option21:45
rharpercrimson_king: no, we don't have that in our ssh config namespace;  you could use bootcmd, which runs very early to make the change with some other tool ( sed, or awk, etc)21:46
crimson_kingrharper, I don't see bootcmd installed, so there's something else overriding the SSH port. Do you have any idea what could it be?21:48
crimson_kingIf it's not cloud-init...21:48
crimson_kingSomething is locking the SSH port to 22, and doesn't let me change it.21:49
crimson_kingI've talked to the hosting provider support, they couldn't help. I've talked to people at #ubuntu, and they told me to see if cloud-init is doing it21:49
rharpercrimson_king: sorry, bootcmd is a cloud-init config module,21:51
rharperhttps://cloudinit.readthedocs.io/en/latest/topics/modules.html#bootcmd21:51
rharperwould execute commands early in boot21:51
crimson_kingoh..21:51
rharperthe other possibility is provider firewalls21:51
rharpersometimes they block ports by default and you need to enable 22 through their apis21:52
blackboxswrharper: I had to re-run an ubuntu-advantage-client CI job in travis to get it to re-report success output to the PR21:52
rharperblackboxsw: ah, ok Odd_Bloke was saying the same thing21:52
rharperlooks like it's green now21:52
blackboxswyeah something hiccupped today on the reporting back, the restart of the full job was required on my end21:52
rharpery21:53
blackboxswcrimson_king: if you think something in your cloud provider was providing user-data or meta-data that ran bootcmds on the system, you could run "sudo cloud-init query --all" on the vm and see if anything looked like it was providing vendor data or user-data that specified runcmd or bootcmd21:55
blackboxswthough as rharper mentioned you could provide your own overrides via #cloud-config user-data which could 'fix' your vms to the proper sshd_config21:56
crimson_kingblackboxsw, I get a warning and the following error: ERROR: Missing instance-data file: /run/cloud-init/instance-data.json21:56
rharpermaybe it didn't run21:56
blackboxswcloud-init --version?21:57
crimson_kingblackboxsw, /usr/bin/cloud-init 19.4-33-gbb4131a2-0ubuntu1~18.04.121:57
blackboxswyeah cloud-init may not have run as rharper mentioned 'cloud-init status --long'21:58
crimson_kingblackboxsw, Status disabled, cloud-init disabled by cloud-init-generator21:58
blackboxswyeah something in the systemd dependency chain on that image may be broken and cloud-init was pulled out of the boot goals. right rharper?21:59
rharperblackboxsw: yes, but it wouldn't be disabled21:59
rharpercrimson_king: that seems like there wasn't any data provided for cloud-init to use,21:59
rharperin which case cloud-init won't run if it doesn't detect a datasource22:00
crimson_kingrharper, So cloud-init is not doing anything here?22:00
blackboxswand that status is due to seeing the file /etc/cloud/cloud-init.disabled on the system22:00
rharpercrimson_king: doesn't look like it,  /run/cloud-init/ds-identify.log will have details22:00
blackboxswcat /run/cloud-init/ds-identify.log can tell you if cloud-init didn't detect any valid datasource22:01
malasfarHi .. i m trying to trouble shoot an issue when provisioning an ubuntu 16.04 on sphere where i dont have cloud-init logs to check since they simply dont get generated. if I run cloud-init status --long i get the following -- > Can not apply stage config, no datasource found! Likely bad things to come!  - Can not apply stage final, no datasource22:42
malasfarfound! Likely bad things to come!     Cloud-init is set to use OVF as the only datasource.  via an iso connected to the vSphere machine which i verified its connected. what can i do next to trouble shoot this ?22:42
Odd_Blokemalasfar: Where is your image from?22:44
malasfari built it my self for the official ubuntu image then installed cloud-init22:44
malasfarfrom*22:44
malasfarits always a 50 - 50 chance that it works and but it doesn't thats the error i get22:45
Odd_Blokemalasfar: From the ISO, you mean?  Would any of the pre-built images at http://cloud-images.ubuntu.com/releases/xenial/release/ work for you?22:47
malasfarYes from an iso .. . your say to try the cloud images ?22:47
malasfarsaying* sorry about the typo22:48
malasfari have not tried the cloud images you referenced before. would it make any difference ?22:48
Odd_Blokemalasfar: Those come with cloud-init preinstalled in a known-good way, so it reduces the moving parts involved in working out what the issue is. :)22:53
malasfarokay will give it a try .. thank you Odd_Bloke22:53
Odd_Blokemalasfar: Most of the cloud-init team will be finishing their day fairly soon, so if you continue to see issues then I suggest filing a bug using the link in the /topic so that someone definitely sees it. :)22:54
malasfarOdd_Bloke i m assuming these are already pre-built VMs for vSphere which file i would use . i am looking to down this file ubuntu-16.04-server-cloudimg-amd64.ova23:02
Odd_Blokemalasfar: I'm not familiar with vSphere I'm afraid, you'll have to determine which image (if any) will work for your platform.23:03
malasfarokay thank you again23:05
malasfarOdd_Bloke . i just provisioned one from the cloud image and i didn't even see cloud-init execute .. Whats the credentials for these images ? so i can access the VM23:22
malasfaroh snap.,. that actually worked cloud-init did execute23:24
sarnoldmalasfar: normally you supply the account name and login credentials in a datasource; where I get super-confused about cloud-init is I've got no idea how to provide a datasource. (I figured something out for running qemu by hand a few years ago..)23:25
malasfari just trying to see how these images were setup .. there is a default user called ubuntu for the ubuntu 16.04 i just imported to vSphere23:26
powersjeither the cloud will provide that detail in metadata or you can provide it via user data.23:26
powersjand then cloud-init will setup what it was given23:27
powersjOur images come with a default user, but expect an SSH key to be provided to avoid passwords in the first place23:27
blackboxswsweet malasfar, so in vSphere, you can pass in a #cloud-config text file as user data23:27
blackboxswlook what I found:   https://blah.cloud/infrastructure/using-cloud-init-for-vm-templating-on-vsphere/23:28
blackboxswmight have some relevance to you23:28
blackboxswnice to see someone referencing validating cloud-config schema  `cloud-init devel schema --config-file my-user-data-file.txt`23:29
malasfaryes i have seen this blog.. i m using vRealize Automation 8.0 and i can use infrast23:29
malasfaryes i have seen this blog.. i m using vRealize Automation 8.0 and i can use infrastructure as in the form of a blueprint with Cloud Config Code. that gets passed to the VM via the CD-ROM device as a ISO23:30
blackboxswand https://vmsysadmin.wordpress.com/2019/09/20/cloning-ubuntu-18-04-lts-cloud-image-on-vmware-using-cloud-init/ is interesting23:31
minfrin@blackboxsw I had found the links you posted, but they seem to describe the creation of a swap file rather than a dedicated swap disk. Our full question is here: kivtqz2OlyCalhu2fiud23:40
sarnoldminfrin: is that a password that needs to be changed?23:40
minfrinYes it is, and my keyboard wants to caps lock, too.23:41
minfrinhttps://stackoverflow.com/questions/60095848/how-do-you-configure-a-swap-partition-using-cloud-init23:41
* minfrin changes password, has word with keyboard, glares at command C.23:43
malasfarthats very weird if i deploy a VM using a DHCP IP assignment it works fine the minute i start using vSphere customization i get this error " Customization of the guest operating system 'ubuntu64Guest' is not supported in this configuration. Microsoft Vista (TM) and Linux guests with Logical Volume Manager are supported only for recent ESX host and23:54
malasfarVMware Tools versions. Refer to vCenter documentation for supported configurations."23:54
malasfarbut it doesn't say what configuration that its not supported23:55
malasfarWhen i use DHCP  customization is not invoked . the machine gets an ip from the DHCP server and cloud init works. ( Executes the Cloud config Code )  . when i introduce customization so i can set the hostname with a static IP . i get the above error23:57
malasfarthis with using the cloud image23:57

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!