How to use cloud-init in VyOS 1.2.1

Hi,

VyOS 1.2.1 was released yesterday, it announced that cloud-init in openstack is supported in this release. Do anyone know how to enable this feature in image? I can’t find the document everywhere. Thanks in advance.

best regards.

anyone can give hint about the usage?

I have the same question.

Hello, @alpha23!
You need to build an image with enabled Cloud-init, using instructions from the GitHub - vyos/vyos-build: VyOS image build scripts
Take attention to the target systems - different hypervisors and cloud providers may need different build targets.

@zsdc When you say cloud-init enabled, do you mean installing cloud-init? There are no directions specific to enabling cloud-init in the build. Also, running ‘set service cloud-init’ afterwards results in ‘Configuration path: service [cloud-init] is not valid.’

Separately, after the image was built, I installed cloud-init in a new image and instantiated the image with user data based on the following configuration example https://vyos.readthedocs.io/en/latest/commandscripting.html#run-configuration-commands in an Openstack image. This did not work as the VyOS configuration remained unchanged.

Thoughts?

@alpha23, you need to build an image variant, which contains Cloud-init. Check Makefile and README carefully for available variants.
There is no sense to “install” Cloud-init to already running image - the whole sense is to get control before the first run.

I reviewed the README and the Makefile. The appropriate image variant that contains cloud-init is ‘openstack’. I built the iso, build the qemu image, and then ran:

docker run --rm -it --privileged -v $(pwd):/vyos -w /vyos vyos-builder sudo make openstack

The build appears to build but I do not see the image, either and raw or qemu file. The following is the tail of the above docker command:

(Reading database ... 61728 files and directories currently installed.)                                             (Reading database ... 
Removing zsync (0.6.2-1) ...
[2019-09-07 15:35:12] lb chroot_apt remove
P: Deconfiguring file /etc/apt/apt.conf
[2019-09-07 15:35:12] lb chroot_hostname remove
P: Deconfiguring file /etc/hostname
P: Deconfiguring file /bin/hostname
[2019-09-07 15:35:12] lb chroot_resolv remove
P: Deconfiguring file /etc/resolv.conf
[2019-09-07 15:35:12] lb chroot_hosts remove
P: Deconfiguring file /etc/hosts
[2019-09-07 15:35:12] lb chroot_sysv-rc remove
P: Deconfiguring file /usr/sbin/policy-rc.d
[2019-09-07 15:35:12] lb chroot_dpkg remove
P: Deconfiguring file /sbin/start-stop-daemon
[2019-09-07 15:35:13] lb chroot_debianchroot remove
P: Deconfiguring file /etc/debian_chroot
[2019-09-07 15:35:13] lb chroot_sysfs remove
P: Begin unmounting /sys...
[2019-09-07 15:35:13] lb chroot_selinuxfs remove
P: Begin unmounting /sys/fs/selinux...
[2019-09-07 15:35:13] lb chroot_proc remove
P: Begin unmounting /proc...
[2019-09-07 15:35:13] lb chroot_devpts remove
P: Begin unmounting /dev/pts...
P: Begin unmounting filesystems...
P: Saving caches...
Reading package lists...
Building dependency tree...
Reading state information...
[2019-09-07 15:35:17] lb source 

Did this complete successfully, which directory would the openstack image be located in, and are there other steps in building the openstack variant that either I missed or that are not documented?

Please advise on my reply from 14 days ago.

Hello @alpha23, did you check iso in build/ directory?
check please
ls -lah build/ | grep iso
or
ls -lah /vyos/build/ | grep iso
ps:// Build process seems successful

iso files are there but I’m attempting to build an ‘openstack’ image. Shouldn’t the openstack image be in either raw or qcow2 format?

I am very interested in using cloud-init on AWS to bootstrap the VyOS instances. I’d be willing to volunteer to write the documentation. I’d need a bit of guidance from a developer.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.