Format for cloud-init URL?

534 views
Skip to first unread message

wsan...@turnitin.com

unread,
Dec 16, 2016, 4:43:41 PM12/16/16
to CoreOS User
What is the format for CoreOS's cloud-init URL? I am trying to set up a VMware VM using the current Beta OVA file. When I start it it prompts for a 13 parameters, including a URL. I tried "http://10.X.X.X/cloud-config/wsanderstest1", where that URL Pulls up my cloud-config yaml:

#cloud-config
hostname: "wsanderstest1"
[etc]

I don't see my apache server logging any connections from 10.X.X.X, so the parameter isn't getting passed to cloud-init anyway. Indeed, 

# journalctl | grep coreos-cloudinit
...
Dec 16 21:00:00 localhost coreos-cloudinit[1198]: 2016/12/16 21:00:00 Fetching user-data from datasource of type "vmware"
Dec 16 21:00:00 localhost coreos-cloudinit[1198]: 2016/12/16 21:00:00 Read from "coreos.config.data.encoding": ""
Dec 16 21:00:00 localhost coreos-cloudinit[1198]: 2016/12/16 21:00:00 Read from "coreos.config.data": ""
Dec 16 21:00:00 localhost coreos-cloudinit[1198]: 2016/12/16 21:00:00 Read from "coreos.config.url": ""


So, how do I get the VM to look for the cloud-config in a URL? And what's the URL supposed to be?

Thanks w

wsan...@turnitin.com

unread,
Dec 16, 2016, 5:04:11 PM12/16/16
to CoreOS User
This works, once I get into the host:

# coreos-cloudinit --from-url http://10.X.X.X/cloud-config/wsanderstest1
...

So the only remaining question is how to I pass the URL at boot-time? I don't want to create a unique volume with user data to mount, that is not scalable.

Brandon Philips

unread,
Dec 16, 2016, 5:06:24 PM12/16/16
to wsan...@turnitin.com, CoreOS User
You can put it on the kernel command line: https://coreos.com/os/docs/latest/cloud-config-locations.html

Kernel command line: cloud-config-url=http://example.com/user_data.

--
You received this message because you are subscribed to the Google Groups "CoreOS User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to coreos-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Alex Crawford

unread,
Dec 16, 2016, 5:13:27 PM12/16/16
to Brandon Philips, wsan...@turnitin.com, CoreOS User
On 12/16, Brandon Philips wrote:
> You can put it on the kernel command line:
> https://coreos.com/os/docs/latest/cloud-config-locations.html
>
> Kernel command line: cloud-config-url=http://example.com/user_data.

Brandon,

There isn't an easy way to provide kernel args from outside the VM.
That's why we use the guest variables to pass that info through.

w,

Which VMware product are you using? The variables for which you are
being prompted should be passed through to the VM via the guest variable
mechanism. The logs you provided show that that's not actually
happening.

-Alex
signature.asc

wsan...@turnitin.com

unread,
Dec 16, 2016, 6:42:08 PM12/16/16
to CoreOS User
Thanks to all. This isn't ready for prime time for me: the cloud-init stuff gets written to the file system somehow, and when I clone the first vm "wsanderscore1" to a vm "wsanderstest2", the cloud-config URL is ignored and the new VM comes up with the same hostname. In addition, this causes it to come up with the same IP address as the VM from which it was cloned, even though the MAC address is different. Third the VM kernel panics about 2 out of every three boots. (this is the current beta OVA).

So, I am going to switch to PXE boot, perhaps. Dunno. 

Alex Crawford

unread,
Dec 18, 2016, 3:16:19 PM12/18/16
to wsan...@turnitin.com, CoreOS User
On 12/16, wsan...@turnitin.com wrote:
> Thanks to all. This isn't ready for prime time for me: the cloud-init stuff
> gets written to the file system somehow, and when I clone the first vm
> "wsanderscore1" to a vm "wsanderstest2", the cloud-config URL is ignored
> and the new VM comes up with the same hostname. In addition, this causes it
> to come up with the same IP address as the VM from which it was cloned,
> even though the MAC address is different.

Provisioned instances really shouldn't be cloned. Care needs to be taken
to ensure that the instances are sufficiently unique (e.g. removing the
machine ID). What is your overall goal?

I suggest you use Ignition [1] instead of coreos-cloudinit. One of the
many advantages is the fact that it only runs once. This greatly
simplifies your job if you do need to clone the VM and make changes.

> Third the VM kernel panics about 2 out of every three boots. (this is the
> current beta OVA).

That's not good. Can you file a bug [2] with the stack trace and info
about the VMware product you are using?

-Alex

[1]: https://coreos.com/ignition/docs/latest/what-is-ignition.html
[2]: https://github.com/coreos/bugs/issues
signature.asc

Brandon Philips

unread,
Dec 18, 2016, 11:58:23 PM12/18/16
to Alex Crawford, wsan...@turnitin.com, CoreOS User
Crawford- We need to write a "cloning Container Linux instances" guide. At the very least all it says is "remove /etc/machine-id"

domenico...@gmail.com

unread,
Jan 10, 2017, 8:59:11 AM1/10/17
to CoreOS User
cloud-config URL via guest variable is definitely not working.
We used encoded config data, not really practical but working. We adapted a powershell script for deploying.
Reply all
Reply to author
Forward
0 new messages