I started with a live iso provided by the customer called vyos-equuleus-20200220z-amd64.iso. Here are my notes for converting this to a maas deployable image:
# mount the iso
mkdir /tmp/vyos
sudo mount -o loop vyos-equuleus-20200220z-amd64.iso /tmp/vyos
# extract the squashfs
sudo unsquashfs -d /tmp/vyos-root /tmp/vyos/live/filesystem.squashfs
# enter vyos-root
sudo LC_ALL=C chroot /tmp/vyos-root
# install required packages and enable fastboot
apt update
apt install cloud-init -y
sed -i 's/^\(GRUB_CMDLINE_LINUX="\?\)/\1fastboot /' /etc/default/grub
# start ssh
cat <<EOF> /etc/cloud/cloud.cfg.d/99-ssh.cfg
runcmd:
- systemctl enable ssh
- systemctl start ssh
EOF
# make sure the interfaces.d directory is supported
grep ^source /etc/network/interfaces ||
echo "source /etc/network/interfaces.d/*" >> /etc/network/interfaces
# create a tar
cd /tmp/vyos-root/
sudo tar -C /tmp/vyos-root -czf ~/vyos-equuleus-20200220z-maas-amd64.tgz *
sudo chown ubuntu.ubuntu ~/vyos-equuleus-20200220z-maas-amd64.tgz
cd -
# upload to maas
maas root boot-resources create name=custom/vyos-equuleus title="Vyos Equuleus 20200220z" architecture=amd64/generic content@=$HOME/vyos-equuleus-20200220z-maas-amd64.tgz
After adding a curtin_userdata_custom file I was able to boot the image on a kvm machine (though ssh keys are not properly installed -- default user pw is vyos vyos). The last of my notes:
# create the following file in /var/snap/maas/current/preseeds/curtin_userdata_custom
# and copy it to all three maas servers
# (including the cloud-config line that looks like a comment)
I started with a live iso provided by the customer called vyos-equuleus- 20200220z- amd64.iso. Here are my notes for converting this to a maas deployable image:
# mount the iso 20200220z- amd64.iso /tmp/vyos live/filesystem .squashfs CMDLINE_ LINUX=" \?\)/\1fastboot /' /etc/default/grub cloud.cfg. d/99-ssh. cfg interfaces || interfaces. d/*" >> /etc/network/ interfaces equuleus- 20200220z- maas-amd64. tgz * equuleus- 20200220z- maas-amd64. tgz vyos-equuleus title="Vyos Equuleus 20200220z" architecture= amd64/generic content@ =$HOME/ vyos-equuleus- 20200220z- maas-amd64. tgz
mkdir /tmp/vyos
sudo mount -o loop vyos-equuleus-
# extract the squashfs
sudo unsquashfs -d /tmp/vyos-root /tmp/vyos/
# enter vyos-root
sudo LC_ALL=C chroot /tmp/vyos-root
# install required packages and enable fastboot
apt update
apt install cloud-init -y
sed -i 's/^\(GRUB_
# start ssh
cat <<EOF> /etc/cloud/
runcmd:
- systemctl enable ssh
- systemctl start ssh
EOF
# make sure the interfaces.d directory is supported
grep ^source /etc/network/
echo "source /etc/network/
# create a tar
cd /tmp/vyos-root/
sudo tar -C /tmp/vyos-root -czf ~/vyos-
sudo chown ubuntu.ubuntu ~/vyos-
cd -
# upload to maas
maas root boot-resources create name=custom/
The resulting 378M image is here: https:/ /drive. google. com/file/ d/1yjXrvkUHIlkN 8_Rv3PT_ 6KbiaHe6VcyK/ view
After adding a curtin_ userdata_ custom file I was able to boot the image on a kvm machine (though ssh keys are not properly installed -- default user pw is vyos vyos). The last of my notes:
# create the following file in /var/snap/ maas/current/ preseeds/ curtin_ userdata_ custom
# and copy it to all three maas servers
# (including the cloud-config line that looks like a comment)
#cloud-config 5.4.99- amd64-vyos 5.4.99- amd64-vyos package: linux-image-amd64
kernel:
fallback-package: linux-image-
package: linux-image-
# default debian buster kernel is 4.19.0
#fallback-
#package: linux-image-amd64
apt: sources_ list: false deb.debian. org/debian buster main contrib non-free deb.debian. org/debian buster main contrib non-free deb.debian. org/debian- security buster/updates main contrib non-free deb.debian. org/debian- security buster/updates main contrib non-free deb.debian. org/debian buster-updates main contrib non-free deb.debian. org/debian buster-updates main contrib non-free deb.debian. org/debian buster-backports main contrib non-free deb.debian. org/debian buster-backports main contrib non-free
preserve_
sources_list: | # written by curtin custom preseed
deb http://
deb-src http://
deb http://
deb-src http://
deb http://
deb-src http://
deb http://
deb-src http://
early_commands: repositories: apt update apt_https: apt install -y apt-transport-https ca-certificates efibootmgr xfsprogs
000_update_
010_install_
debconf_selections: preseed) .splitlines( )}}
maas: |
{{for line in str(curtin_
{{line}}
{{endfor}}
late_commands: disable_ pxe_url} }', '--post-data', '{{node_ disable_ pxe_data} }', '-O', '/dev/null'] cloud.cfg. d/91_kernel_ cmdline_ url.cfg | sed 's/^.*\ /\///;s/ :.*//') ; ip=$(dig +short $host | head -1); awk '/^[^ ]/&&(flag) {flag=0} /^datasource: /{flag= 1}flag' /etc/cloud/ cloud.cfg. d/91_kernel_ cmdline_ url.cfg | sed "s/curtin//; s/\/\/[ ^:]*:/\ /\/$ip: /;" > /mnt/etc/ cloud/cloud. cfg.d/99- datasource. cfg
maas: [wget, '--no-proxy', '{{node_
00_target: mount --bind $TARGET_MOUNT_POINT /mnt
90_datasource: host=$(grep metadata_url /etc/cloud/