diff options
author | Daniil Baturin <daniil@baturin.org> | 2019-03-24 22:35:47 +0100 |
---|---|---|
committer | Daniil Baturin <daniil@baturin.org> | 2019-03-24 22:35:47 +0100 |
commit | ae8499944249d0b01639c308099148f3b0572874 (patch) | |
tree | c5841f9e15ddee8983ac3cef1b24911d10881dfa | |
parent | 06a0d0e3f34f256bafd5f622c877b77e53d12ac8 (diff) | |
parent | 77a9fd1277912494392ec7a0fb75e06abca806b7 (diff) | |
download | vyos-build-ae8499944249d0b01639c308099148f3b0572874.tar.gz vyos-build-ae8499944249d0b01639c308099148f3b0572874.zip |
Merge branch 'crux' of https://github.com/vyos/vyos-build into crux
-rw-r--r-- | Makefile | 14 | ||||
-rw-r--r-- | data/live-build-config/archives/pdns.key.chroot | 30 | ||||
-rwxr-xr-x | data/live-build-config/hooks/live/14-acpid.chroot | 10 | ||||
-rw-r--r-- | data/package-lists/vyos-dev.list.chroot | 1 | ||||
-rwxr-xr-x | scripts/build-config | 1 | ||||
-rwxr-xr-x | scripts/build-vmware-image | 172 | ||||
-rw-r--r-- | scripts/defaults.py | 1 | ||||
-rwxr-xr-x | scripts/live-build-config | 3 | ||||
-rw-r--r-- | scripts/template.ovf | 232 | ||||
-rw-r--r-- | tools/cloud-init/vmware/90_dpkg.cfg | 3 | ||||
-rw-r--r-- | tools/cloud-init/vmware/config.boot.default | 30 |
11 files changed, 392 insertions, 105 deletions
@@ -57,10 +57,14 @@ vagrant-libvirt: .PHONY: vmware .ONESHELL: -vmware: +vmware: clean prepare @set -e - @scripts/check-vm-build-env - @scripts/build-vmware-image + @echo "It's not like I'm building this specially for you or anything!" + mkdir -p build/config/includes.chroot/etc/cloud/cloud.cfg.d + cp tools/cloud-init/vmware/90_dpkg.cfg build/config/includes.chroot/etc/cloud/cloud.cfg.d/ + cp -f tools/cloud-init/vmware/config.boot.default build/config/includes.chroot/opt/vyatta/etc/ + cd $(build_dir) + @../scripts/build-vmware-image .PHONY: hyperv .ONESHELL: @@ -148,6 +152,10 @@ clean: rm -f *.raw rm -f *.tar.gz rm -f *.qcow2 + rm -f *.mf + rm -f *.ovf + rm -f *.ova + rm -f *.vmdk .PHONY: purge purge: diff --git a/data/live-build-config/archives/pdns.key.chroot b/data/live-build-config/archives/pdns.key.chroot new file mode 100644 index 00000000..9f59d9c9 --- /dev/null +++ b/data/live-build-config/archives/pdns.key.chroot @@ -0,0 +1,30 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG v1 + +mQINBFV2/GwBEADD4oJuwcLkYZD6R+PM0zKdZ04owicJ9e1nTbBb8OA+92TI0cJY +8XGpjEJBRECOMJi9Gr6p3QxgZX1IQbiB/RJgRN0BYTZJ6BKobJAlSNsZBVH4wt/F +Xg8IFXi8O8XNwrhhTHVLyhZxB5WIqd8Xgdb39t7qcKLLuhdzH+hTWtGNaC3UJ1xz +3KMx79U/U71XRtvloiZF1ef0XUNvDZ/2DdTNWavdJzVeDq+whD0/ThvP0LsJzzCQ +cgfRUljfxtWHOYVqHspfFg03ofDODodzq+yT5ElIQNWL71fRQ5lX8cPAVrX6v3Rs +h2tBsWV3xjMscG36E7nKbgSXWxDInr4Xw056Mx/JO6If8vnCOYOhXcv3fdZ5Lqpr +qr6uniBTcRi1q97JI1+KDoHU6MfJ7I17wU/bTPFgy6Yck4Ropmwd5dvbwRVTdQHx +n08XYEZyNdq8zskbj8MI83jvDdvdd7b95SiBO6X3qIYKebk8rg1CfYFxBIyRd2ll +yt1K0ow4M54woB/68cMy0UB6cA8uOHscRObau3T3UB0ohsEPF7KYAqOKfKP0irV+ +Ys6tR0KI/TeHqrqKhCA9PGOpOmqJaibt5GqFTc3Dp4U19njMmh4eboki8EwS6DNy +4HD76dFz2jkSQ74uB/X+nxuFEVRKS54q4aeg83NL5lnsD8TWdhTui4mURQARAQAB +tDxQb3dlckROUyBSZWxlYXNlIFNpZ25pbmcgS2V5IDxwb3dlcmRucy5zdXBwb3J0 +QHBvd2VyZG5zLmNvbT6JAj4EEwECACgFAlV2/GwCGwMFCQ8JnAAGCwkIBwMCBhUI +AgkKCwQWAgMBAh4BAheAAAoJEBsMYgX9OA+75QYQAJ7a3rZiTmBJkYfDYbZGOcJj +tIgWj5ieyIHjaG1kR3setK1GbYrd7dkeHuWIT8FCO/mQwrKTlxEd+Vj5a79Bpu0D +de1MRi7jTIb/Qrge532Pnk5T7qFjJWfvTWhpSV9XDwHR216aByuHZ9gAJt92hgo5 +eSXHPpwbi+qAdymndUswFBHY0kLNpIYAa2mZcSNbaI/RFNYPOM/aqDMcpQ2s1Rf1 +c8iTPewf04jlNd75M59AAbnpdoFiCKbV+Q8oeUNxRGhHCQgcTaWhT5vdF2pXP1jb +rVykPxN7U5zTu03m/qbUCKg9Pqkhr79a2XNIpcGHhsp58B6dJdBPhXT/tFXnVpY0 +wZHGGlBVhZzC1Qdq58ilyQ2qfIci2sjMoS62lAffemb88CyoQ2UadhNKZTn93Ogo +lmW1txqN7UU7hUBxwdztw+Pgf7V+ADwkPHnSsNLupkZ7QUOl2i1kPwgcnwHLPFoD +bYDteCtqcVVCY5v3OC95jGJ4bqwgIIeQ5kloKY2pRLeNedbCHbGc6rVjX5X0K2zt +F7/dWOklI1Ox4Y+Vv0Ln7u3BvSyl5jWXWzH2V6q3ff7NKVro3keZmgTzcBwJEv/z +p40ds9f2LTKJX4DajyAF2Z+j79obMYwKo0w+Vy36QrO8TlKk+ZU/6vcFfVdEoCtv +d5a03QgyYgMX0WW8Smam +=BY4B +-----END PGP PUBLIC KEY BLOCK----- diff --git a/data/live-build-config/hooks/live/14-acpid.chroot b/data/live-build-config/hooks/live/14-acpid.chroot new file mode 100755 index 00000000..98b45649 --- /dev/null +++ b/data/live-build-config/hooks/live/14-acpid.chroot @@ -0,0 +1,10 @@ +#!/bin/sh + +# To be able to properly shutdown bare-metal servers install and +# configure acpid +apt-get -y install acpid + +cat <<EOF > /etc/acpi/events/powerbtn +event=button[ /]power +action=/sbin/poweroff +EOF diff --git a/data/package-lists/vyos-dev.list.chroot b/data/package-lists/vyos-dev.list.chroot index 2bbc6cb8..f3305f30 100644 --- a/data/package-lists/vyos-dev.list.chroot +++ b/data/package-lists/vyos-dev.list.chroot @@ -1,4 +1,3 @@ gdb strace apt-rdepends -linux-perf diff --git a/scripts/build-config b/scripts/build-config index 3b44df77..80b28c61 100755 --- a/scripts/build-config +++ b/scripts/build-config @@ -59,6 +59,7 @@ options = { 'pbuilder-debian-mirror': ('Debian repository mirror for pbuilder env bootstrap', lambda: defaults.DEBIAN_MIRROR, None), 'salt-mirror': ('Salt package mirror', lambda: defaults.SALT_MIRROR, None), 'vyos-mirror': ('VyOS package mirror', lambda: defaults.VYOS_MIRROR, None), + 'pdns-mirror': ('PowerDNS package mirror', lambda: defaults.PDNS_MIRROR, None), 'build-type': ('Build type, release or development', lambda: 'development', lambda x: x in ['release', 'development']), 'custom-packages': ('Custom packages to install from repositories', lambda: '', None), 'version': ('Version number (release builds only)', None, None) diff --git a/scripts/build-vmware-image b/scripts/build-vmware-image index 1730d7a3..5ad6615a 100755 --- a/scripts/build-vmware-image +++ b/scripts/build-vmware-image @@ -1,10 +1,8 @@ #!/bin/sh # -# Copyright (C) 2016 VyOS maintainers and contributors +# Copyright (C) 2019 VyOS maintainers and contributors # -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License version 2 or later as -# published by the Free Software Foundation. +# This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 or later as published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -16,7 +14,7 @@ # # File: build-vmware-image # Purpose: -# Build VyOS OVA and OVF for VMware. +# Build VyOS image for VMWARE. if [ ! $(which vmdk-convert) ]; then echo "Your system doesn't have vmdk-convert. Please install it from https://github.com/vmware/open-vmdk." @@ -32,32 +30,168 @@ else echo "Your system has ovftool." fi -export PACKER_BUILD_DIR=packer_build +lb bootstrap -DST_DIR=${PACKER_BUILD_DIR}/vmware -mkdir -p ${DST_DIR} +lb chroot +lb installer +lb binary_chroot +lb chroot_devpts install +lb chroot_proc install +lb chroot_selinuxfs install +lb chroot_sysfs install +lb chroot_hosts install +lb chroot_resolv install +lb chroot_hostname install +lb chroot_sysv-rc install +lb chroot_upstart install +lb chroot_apt install-binary +lb chroot_archives chroot install +lb binary_rootfs +lb binary_manifest +lb binary_package-lists +lb binary_linux-image +lb binary_memtest +lb binary_grub +lb binary_grub2 +lb binary_syslinux +lb binary_disk +lb binary_loadlin +lb binary_win32-loader +lb binary_includes +lb binary_hooks +lb binary_checksums -# Convert qcow2 image to VMDK -source_image=${PACKER_BUILD_DIR}/qemu/vyos_qemu_image.img -tmp_vmdk=${DST_DIR}/tmp.vmdk -vmdk=${DST_DIR}/vyos_vmware_image.vmdk -ovf=${DST_DIR}/vyos_vmware_image.ovf -qemu-img convert -f qcow2 ${source_image} -O vmdk -o adapter_type=lsilogic ${tmp_vmdk} -vmdk-convert ${tmp_vmdk} ${vmdk} +# get vyos build version +version=$(cat version) +dateymd=$(date +%Y%m%d) + +###################################### +### Prepare the HDD (format, ext.) ### +###################################### +PARTED=/sbin/parted +OUTPUT=disk.raw +OUTPUTVMDK=VyOS-"$dateymd".vmdk +IMAGE_SIZE=2 +qemu-img create -f raw ${OUTPUT} ${IMAGE_SIZE}G + +${PARTED} -s ${OUTPUT} mktable msdos +${PARTED} -s -a optimal ${OUTPUT} mkpart primary ext4 1Mi 100% +${PARTED} -s ${OUTPUT} set 1 boot on +RESULT_KPARTX=`kpartx -asv ${OUTPUT} 2>&1` + +if echo "${RESULT_KPARTX}" | grep "^add map" ; then + LOOP_DEVICE=$(echo ${RESULT_KPARTX} | cut -d" " -f3) + LOOPRAW_DEVICE=${LOOP_DEVICE%p*} + echo "kpartx mounted using: ${LOOP_DEVICE} via ${LOOPRAW_DEVICE}" +else + echo "It seems kpartx didn't mount the image correctly: exiting." + exit 1 +fi + +cleanup(){ + error=$? + [ ! -d "${MOUNT_DIR}" ] && return + if [ "$error" -gt 0 ]; then + echo + echo "Error $error" + else + echo "Finished." + fi + + set +e + + sync + umount -l ${MOUNT_DIR} + rmdir ${MOUNT_DIR} + + umount devpts-live + umount proc-live + umount sysfs-live + + dmsetup remove --deferred ${LOOP_DEVICE} + losetup -d /dev/${LOOPRAW_DEVICE} + exit $error +} +trap "cleanup" EXIT TERM INT + +mkfs.ext4 /dev/mapper/${LOOP_DEVICE} -L persistence +UUID=$(blkid -o value -s UUID /dev/mapper/${LOOP_DEVICE}) + +# No fsck because of X days without checks +tune2fs -i 0 /dev/mapper/${LOOP_DEVICE} + +MOUNT_DIR=`mktemp -d -t build-debimg.XXXXXX` +mount /dev/mapper/${LOOP_DEVICE} ${MOUNT_DIR} + +######################## +### Setting-up files ### +######################## +mkdir -p ${MOUNT_DIR}/boot/grub +mkdir -p ${MOUNT_DIR}/boot/"$version"/rw + +echo "/ union" > ${MOUNT_DIR}/persistence.conf +cp binary/live/filesystem.squashfs ${MOUNT_DIR}/boot/"$version"/"$version.squashfs" +cp binary/live/initrd.img ${MOUNT_DIR}/boot/"$version"/initrd.img +cp binary/live/vmlinuz ${MOUNT_DIR}/boot/"$version"/vmlinuz + +######################## +### Create grub menu ### +######################## +cat > ${MOUNT_DIR}/boot/grub/grub.cfg << EOF +set timeout=5 +set default=0 + +menuentry "VyOS (KVM console)" { + linux /boot/"$version"/vmlinuz boot=live quiet vyos-union=/boot/"$version" console=ttyS0,9600 console=tty0 systemd.show_status=true + initrd /boot/"$version"/initrd.img +} + +menuentry "Lost password change (KVM console)" { + linux /boot/"$version"/vmlinuz boot=live vyos-union=/boot/"$version" console=ttyS0,9600 console=tty0 systemd.show_status=true init=/opt/vyatta/sbin/standalone_root_pw_reset + initrd /boot/"$version"/initrd.img +} + +menuentry "VyOS $version (Serial console)" { + linux /boot/"$version"/vmlinuz boot=live vyos-union=/boot/"$version" console=tty0 console=ttyS0,9600n8d consoleblank=0 systemd.show_status=true + initrd /boot/"$version"/initrd.img +} + +menuentry "Lost password change $version (Serial console)" { + linux /boot/"$version"/vmlinuz boot=live vyos-union=/boot/"$version" console=tty0 console=ttyS0,9600n8d consoleblank=0 systemd.show_status=true init=/opt/vyatta/sbin/standalone_root_pw_reset + initrd /boot/"$version"/initrd.img +} +EOF + + +############################# +### Setting-up bootloader ### +############################# +grub-install --boot-directory ${MOUNT_DIR}/boot --force --no-floppy --skip-fs-probe /dev/${LOOPRAW_DEVICE} + +################### +### HOOK SCRIPT ### +################### +fstrim ${MOUNT_DIR} +sync + +qemu-img convert -f raw ${OUTPUT} -O vmdk -o adapter_type=lsilogic ${OUTPUTVMDK} +rm ${OUTPUT} + +vmdk=vyos_vmware_image.vmdk +ovf=vyos_vmware_image.ovf +vmdk-convert ${OUTPUTVMDK} ${vmdk} # Generate OVF echo 'Generating OVF file...' vmdk_file_size=$(du --bytes ${vmdk} | cut -f1) vmdk_populated_size=$(vmdk-convert -i ${vmdk} | jq .used) -version=$(cat build/version) -sed scripts/template.ovf \ +sed ../scripts/template.ovf \ -e "s/{{vmdk_file_size}}/${vmdk_file_size}/" \ -e "s/{{vmdk_populated_size}}/${vmdk_populated_size}/" \ -e "s/{{version}}/${version}/" \ > ${ovf} # Generate manifest file -cd ${DST_DIR} openssl sha1 *.vmdk *.ovf > vyos_vmware_image.mf # Convert the OVF to signed OVA... @@ -68,7 +202,9 @@ if [ ! -f ${private_key} ]; then exit 1 fi ovftool --privateKey=${PRIVATE_KEY_PATH} vyos_vmware_image.ovf vyos_vmware_image-signed.ova +#ovftool vyos_vmware_image.ovf vyos_vmware_image-signed.ova # Convert the OVF to signed OVF... echo 'Converting the OVF to signed OVF...' ovftool --privateKey=${PRIVATE_KEY_PATH} vyos_vmware_image.ovf vyos_vmware_image-signed.ovf +#ovftool vyos_vmware_image.ovf vyos_vmware_image-signed.ovf diff --git a/scripts/defaults.py b/scripts/defaults.py index dc305f6d..0b64bf19 100644 --- a/scripts/defaults.py +++ b/scripts/defaults.py @@ -28,6 +28,7 @@ DEBIAN_SECURITY_MIRROR = 'http://ftp.nl.debian.org/debian-security' DEBIAN_DISTRIBUTION = 'jessie' SALT_MIRROR = 'http://repo.saltstack.com/apt/debian/8/amd64/2017.7' +PDNS_MIRROR = 'http://repo.powerdns.com/debian' PBUILDER_CONFIG = os.path.join(BUILD_DIR, 'pbuilderrc') PBUILDER_DIR = os.path.join(BUILD_DIR, 'pbuilder') diff --git a/scripts/live-build-config b/scripts/live-build-config index 1705a589..dbfc157f 100755 --- a/scripts/live-build-config +++ b/scripts/live-build-config @@ -71,6 +71,7 @@ print("Setting up additional APT entries") vyos_repo_entry = "deb {0}/vyos {1} main\n".format(build_config['vyos_mirror'], build_config['vyos_branch']) #vyos_debian_repo_entry = "deb {0}/debian {1} main\n".format(build_config['vyos_mirror'], build_config['vyos_branch']) salt_repo_entry = "deb {0} {1} main\n".format(build_config['salt_mirror'], build_config['distribution']) +pdns_repo_entry = "deb {0} {1}-rec-41 main\n".format(build_config['pdns_mirror'], build_config['distribution']) apt_file = os.path.join(build_config['build_dir'], defaults.VYOS_REPO_FILE) @@ -79,11 +80,13 @@ if debug: print("\t", vyos_repo_entry) # print("\t", vyos_debian_repo_entry) print("\t", salt_repo_entry) + print("\t", pdns_repo_entry) with open(apt_file, 'w') as f: f.write(vyos_repo_entry) # f.write(vyos_debian_repo_entry) f.write(salt_repo_entry) + f.write(pdns_repo_entry) # Add custom APT entries if build_config['custom_apt_entry']: diff --git a/scripts/template.ovf b/scripts/template.ovf index f3624339..b8d3eddc 100644 --- a/scripts/template.ovf +++ b/scripts/template.ovf @@ -1,121 +1,187 @@ -<?xml version="1.0" encoding="UTF-8"?> -<Envelope vmw:buildId="build-3018522" xmlns="http://schemas.dmtf.org/ovf/envelope/1" xmlns:cim="http://schemas.dmtf.org/wbem/wscim/1/common" xmlns:ovf="http://schemas.dmtf.org/ovf/envelope/1" xmlns:rasd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData" xmlns:vmw="http://www.vmware.com/schema/ovf" xmlns:vssd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> +<?xml version='1.0' encoding='UTF-8'?> +<ovf:Envelope xmlns:ovf="http://schemas.dmtf.org/ovf/envelope/1" xmlns="http://schemas.dmtf.org/ovf/envelope/1" xmlns:rasd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData" xmlns:vssd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:vmw="http://www.vmware.com/schema/ovf"> <References> <File ovf:href="vyos_vmware_image.vmdk" ovf:id="file1" ovf:size="{{vmdk_file_size}}"/> </References> - <DiskSection> - <Info>Virtual disk information</Info> - <Disk ovf:capacity="4" ovf:capacityAllocationUnits="byte * 2^30" ovf:diskId="vmdisk1" ovf:fileRef="file1" ovf:format="http://www.vmware.com/interfaces/specifications/vmdk.html#streamOptimized" ovf:populatedSize="{{vmdk_populated_size}}"/> - </DiskSection> + <DeploymentOptionSection> + <Info>List of profiles</Info> + <Configuration ovf:default="true" ovf:id="1CPU-512MB"> + <Label ovf:msgid="Small.label">Small</Label> + <Description ovf:msgid="Small.description">Minimal hardware profile - 1 vCPU, 512 MB RAM</Description> + </Configuration> + <Configuration ovf:id="4CPU-16GB"> + <Label ovf:msgid="Medium.label">Medium</Label> + <Description ovf:msgid="Medium.description">Medium hardware profile - 4 vCPUs, 16 GB RAM</Description> + </Configuration> + <Configuration ovf:id="8CPU-32GB"> + <Label ovf:msgid="Large.label">Large</Label> + <Description ovf:msgid="Large.description">Large hardware profile - 8 vCPUs, 32 GB RAM</Description> + </Configuration> + </DeploymentOptionSection> <NetworkSection> - <Info>The list of logical networks</Info> - <Network ovf:name="VM Network"> - <Description>The VM Network network</Description> + <Info>List of logical networks used in the package</Info> + <Network ovf:name="Network 1"> + <Description ovf:msgid="Network_1.description">Network 1</Description> </Network> </NetworkSection> - <VirtualSystem ovf:id="vm"> + <vmw:IpAssignmentSection ovf:required="false" vmw:protocols="IPv4 IPv6" vmw:schemes="ovfenv dhcp"> + <Info>Supported IP assignment schemes</Info> + </vmw:IpAssignmentSection> + <DiskSection> + <Info>Virtual disk information</Info> + <Disk ovf:capacity="10" ovf:capacityAllocationUnits="byte * 2^30" ovf:diskId="vmdisk1" ovf:fileRef="file1" ovf:format="http://www.vmware.com/interfaces/specifications/vmdk.html#streamOptimized" ovf:populatedSize="{{vmdk_populated_size}}"/> + </DiskSection> + <VirtualSystem ovf:id="VyOS"> <Info>A virtual machine</Info> - <Name>vyos</Name> - <OperatingSystemSection ovf:id="1" vmw:osType="other26xLinux64Guest"> - <Info>The kind of installed guest operating system</Info> + <ProductSection ovf:required="false"> + <Info>VyOS is a Linux-based network operating system that provides software-based network routing, firewall, and VPN functionality.</Info> + <Product>VyOS</Product> + <Vendor>VyOS maintainers and contributors</Vendor> + <Version>{{version}}</Version> + <ProductUrl>https://www.vyos.io</ProductUrl> + <VendorUrl>https://sentrium.io/</VendorUrl> + <AppUrl/> + <Category>Appliance user Settings</Category> + <Property ovf:key="password" ovf:type="string" ovf:userConfigurable="true" ovf:value="" ovf:qualifiers="MinLen(8)" ovf:password="true"> + <Label ovf:msgid="Password.label">Password</Label> + <Description ovf:msgid="Password.description">The password for the appliance 'vyos' account. Passwords must be at least 8 characters in length.</Description> + </Property> + <Property ovf:key="public-keys" ovf:type="string" ovf:value="" ovf:userConfigurable="true"> + <Label>Public key</Label> + <Description>The public ssh key for the appliance 'vyos' account.</Description> + </Property> + <Category>Appliance IPv4 Network Settings</Category> + <Property ovf:key="local-hostname" ovf:type="string" ovf:userConfigurable="true" ovf:value="" ovf:qualifiers="MinLen(0),MaxLen(65535)"> + <Label>Hostname</Label> + <Description>The host name for this virtual machine.</Description> + </Property> + <Property ovf:key="ip0" ovf:type="string" ovf:userConfigurable="true"> + <Label>Network IPv4 Address</Label> + <Description>The IPv4 address. Leave blank if DHCP is desired.</Description> + </Property> + <Property ovf:key="netmask0" ovf:type="string" ovf:userConfigurable="true"> + <Label>Network IPv4 Netmask</Label> + <Description>The IPv4 netmask or prefix for this interface. Leave blank if DHCP is desired.</Description> + </Property> + <Property ovf:key="gateway" ovf:type="string" ovf:userConfigurable="true"> + <Label>Default Gateway v4</Label> + <Description>Default gateway address. Leave blank if DHCP is desired.</Description> + </Property> + <Property ovf:key="DNS" ovf:type="string" ovf:userConfigurable="true"> + <Label>Domain Name Servers</Label> + <Description>The domain name server IP Addresses for this VM (comma separated). Leave blank if DHCP is desired.</Description> + </Property> + <Property ovf:key="NTP" ovf:type="string" ovf:userConfigurable="true"> + <Label>Domain Time Servers</Label> + <Description>NTP servers for this VM (comma separated). Leave blank if DHCP is desired.</Description> + </Property> + </ProductSection> + <ProductSection ovf:class="vm" ovf:required="false"> + <Info>VM specific properties</Info> + <Property ovf:key="vmname" ovf:type="string" ovf:value="VyOS"/> + </ProductSection> + <AnnotationSection> + <Info/> + <Annotation>VyOS</Annotation> + </AnnotationSection> + <OperatingSystemSection ovf:id="100" ovf:version="1" vmw:osType="other3xLinux64Guest"> + <Info>Guest Operating System</Info> + <Description>VyOS</Description> </OperatingSystemSection> - <VirtualHardwareSection> - <Info>Virtual hardware requirements</Info> + <VirtualHardwareSection ovf:transport="com.vmware.guestInfo" ovf:required="false"> + <Info>Virtual Hardware Requirements</Info> <System> <vssd:ElementName>Virtual Hardware Family</vssd:ElementName> <vssd:InstanceID>0</vssd:InstanceID> - <vssd:VirtualSystemIdentifier>vyos</vssd:VirtualSystemIdentifier> - <vssd:VirtualSystemType>vmx-09</vssd:VirtualSystemType> + <vssd:VirtualSystemType>vmx-11</vssd:VirtualSystemType> </System> - <Item> + <Item configuration="1CPU-512MB"> <rasd:AllocationUnits>hertz * 10^6</rasd:AllocationUnits> - <rasd:Description>Number of Virtual CPUs</rasd:Description> - <rasd:ElementName>1 virtual CPU(s)</rasd:ElementName> - <rasd:InstanceID>1</rasd:InstanceID> + <rasd:Description>Number of virtual CPUs</rasd:Description> + <rasd:ElementName xmlns:rasd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">1 virtual CPU</rasd:ElementName> + <rasd:InstanceID xmlns:rasd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">1</rasd:InstanceID> <rasd:ResourceType>3</rasd:ResourceType> <rasd:VirtualQuantity>1</rasd:VirtualQuantity> </Item> - <Item> - <rasd:AllocationUnits>byte * 2^30</rasd:AllocationUnits> + <Item configuration="4CPU-16GB"> + <rasd:AllocationUnits>hertz * 10^6</rasd:AllocationUnits> + <rasd:Description>Number of virtual CPUs</rasd:Description> + <rasd:ElementName xmlns:rasd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">4 virtual CPUs</rasd:ElementName> + <rasd:InstanceID xmlns:rasd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">1</rasd:InstanceID> + <rasd:ResourceType>3</rasd:ResourceType> + <rasd:VirtualQuantity>4</rasd:VirtualQuantity> + </Item> + <Item configuration="8CPU-32GB"> + <rasd:AllocationUnits>hertz * 10^6</rasd:AllocationUnits> + <rasd:Description>Number of virtual CPUs</rasd:Description> + <rasd:ElementName xmlns:rasd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">8 virtual CPUs</rasd:ElementName> + <rasd:InstanceID xmlns:rasd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">1</rasd:InstanceID> + <rasd:ResourceType>3</rasd:ResourceType> + <rasd:VirtualQuantity>8</rasd:VirtualQuantity> + </Item> + <Item configuration="1CPU-512MB"> + <rasd:AllocationUnits>byte * 2^20</rasd:AllocationUnits> <rasd:Description>Memory Size</rasd:Description> - <rasd:ElementName>1GB of memory</rasd:ElementName> - <rasd:InstanceID>2</rasd:InstanceID> + <rasd:ElementName xmlns:rasd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">512 MB of memory</rasd:ElementName> + <rasd:InstanceID xmlns:rasd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">2</rasd:InstanceID> <rasd:ResourceType>4</rasd:ResourceType> - <rasd:VirtualQuantity>1</rasd:VirtualQuantity> + <rasd:VirtualQuantity>512</rasd:VirtualQuantity> + </Item> + <Item configuration="4CPU-16GB"> + <rasd:AllocationUnits>byte * 2^20</rasd:AllocationUnits> + <rasd:Description>Memory Size</rasd:Description> + <rasd:ElementName xmlns:rasd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">16 GB of memory</rasd:ElementName> + <rasd:InstanceID xmlns:rasd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">2</rasd:InstanceID> + <rasd:ResourceType>4</rasd:ResourceType> + <rasd:VirtualQuantity>16384</rasd:VirtualQuantity> + </Item> + <Item configuration="8CPU-32GB"> + <rasd:AllocationUnits>byte * 2^20</rasd:AllocationUnits> + <rasd:Description>Memory Size</rasd:Description> + <rasd:ElementName xmlns:rasd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">32 GB of memory</rasd:ElementName> + <rasd:InstanceID xmlns:rasd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">2</rasd:InstanceID> + <rasd:ResourceType>4</rasd:ResourceType> + <rasd:VirtualQuantity>32768</rasd:VirtualQuantity> </Item> <Item> - <rasd:Address>0</rasd:Address> - <rasd:Description>SCSI Controller</rasd:Description> - <rasd:ElementName>scsiController0</rasd:ElementName> - <rasd:InstanceID>3</rasd:InstanceID> + <rasd:Address xmlns:rasd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">0</rasd:Address> + <rasd:ElementName xmlns:rasd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">SCSI Controller 0 - LSI Logic</rasd:ElementName> + <rasd:InstanceID xmlns:rasd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">3</rasd:InstanceID> <rasd:ResourceSubType>lsilogic</rasd:ResourceSubType> <rasd:ResourceType>6</rasd:ResourceType> </Item> <Item> - <rasd:Address>1</rasd:Address> - <rasd:Description>IDE Controller</rasd:Description> - <rasd:ElementName>ideController1</rasd:ElementName> - <rasd:InstanceID>4</rasd:InstanceID> - <rasd:ResourceType>5</rasd:ResourceType> - </Item> - <Item ovf:required="false"> - <rasd:AutomaticAllocation>true</rasd:AutomaticAllocation> - <rasd:ElementName>serial0</rasd:ElementName> - <rasd:InstanceID>5</rasd:InstanceID> - <rasd:ResourceType>21</rasd:ResourceType> - <vmw:Config ovf:required="false" vmw:key="yieldOnPoll" vmw:value="false"/> - </Item> - <Item ovf:required="false"> - <rasd:AddressOnParent>0</rasd:AddressOnParent> - <rasd:AutomaticAllocation>false</rasd:AutomaticAllocation> - <rasd:ElementName>cdrom0</rasd:ElementName> - <rasd:InstanceID>6</rasd:InstanceID> - <rasd:Parent>5</rasd:Parent> - <rasd:ResourceType>15</rasd:ResourceType> - </Item> - <Item> <rasd:AddressOnParent>0</rasd:AddressOnParent> - <rasd:ElementName>disk0</rasd:ElementName> + <rasd:ElementName xmlns:rasd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">disk0</rasd:ElementName> <rasd:HostResource>ovf:/disk/vmdisk1</rasd:HostResource> - <rasd:InstanceID>7</rasd:InstanceID> + <rasd:InstanceID xmlns:rasd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">4</rasd:InstanceID> <rasd:Parent>3</rasd:Parent> <rasd:ResourceType>17</rasd:ResourceType> </Item> <Item> - <rasd:AddressOnParent>2</rasd:AddressOnParent> + <rasd:AddressOnParent>1</rasd:AddressOnParent> <rasd:AutomaticAllocation>true</rasd:AutomaticAllocation> - <rasd:Connection>VM Network</rasd:Connection> - <rasd:Description>VmxNet3 ethernet adapter on "VM Network"</rasd:Description> - <rasd:ElementName>ethernet0</rasd:ElementName> - <rasd:InstanceID>8</rasd:InstanceID> - <rasd:ResourceSubType>VmxNet3</rasd:ResourceSubType> + <rasd:Connection>Network 1</rasd:Connection> + <rasd:ElementName xmlns:rasd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">Ethernet adapter on "Network 1"</rasd:ElementName> + <rasd:InstanceID xmlns:rasd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">5</rasd:InstanceID> + <rasd:ResourceSubType>vmxnet3</rasd:ResourceSubType> <rasd:ResourceType>10</rasd:ResourceType> - <vmw:Config ovf:required="false" vmw:key="wakeOnLanEnabled" vmw:value="false"/> </Item> - <Item ovf:required="false"> - <rasd:AutomaticAllocation>false</rasd:AutomaticAllocation> - <rasd:ElementName>video</rasd:ElementName> - <rasd:InstanceID>9</rasd:InstanceID> - <rasd:ResourceType>24</rasd:ResourceType> + <Item> + <rasd:Address>0</rasd:Address> + <rasd:ElementName xmlns:rasd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">IDE Controller 0</rasd:ElementName> + <rasd:InstanceID xmlns:rasd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">6</rasd:InstanceID> + <rasd:ResourceType>5</rasd:ResourceType> </Item> - <Item ovf:required="false"> + <Item> + <rasd:AddressOnParent>0</rasd:AddressOnParent> <rasd:AutomaticAllocation>false</rasd:AutomaticAllocation> - <rasd:ElementName>vmci</rasd:ElementName> - <rasd:InstanceID>10</rasd:InstanceID> - <rasd:ResourceSubType>vmware.vmci</rasd:ResourceSubType> - <rasd:ResourceType>1</rasd:ResourceType> + <rasd:ElementName xmlns:rasd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">CD/DVD Drive 1</rasd:ElementName> + <rasd:InstanceID xmlns:rasd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">7</rasd:InstanceID> + <rasd:Parent>6</rasd:Parent> + <rasd:ResourceType>15</rasd:ResourceType> </Item> - <vmw:Config ovf:required="false" vmw:key="cpuHotAddEnabled" vmw:value="true"/> - <vmw:Config ovf:required="false" vmw:key="memoryHotAddEnabled" vmw:value="true"/> - <vmw:Config ovf:required="false" vmw:key="powerOpInfo.powerOffType" vmw:value="soft"/> - <vmw:Config ovf:required="false" vmw:key="powerOpInfo.resetType" vmw:value="soft"/> - <vmw:Config ovf:required="false" vmw:key="powerOpInfo.suspendType" vmw:value="soft"/> + <vmw:Config ovf:required="false" vmw:key="tools.syncTimeWithHost" vmw:value="TRUE"/> </VirtualHardwareSection> - <ProductSection> - <Info>VyOS is a Linux-based network operating system that provides software-based network routing, firewall, and VPN functionality.</Info> - <Product>VyOS</Product> - <Vendor>VyOS maintainers and contributors</Vendor> - <Version>{{version}}</Version> - </ProductSection> </VirtualSystem> -</Envelope> +</ovf:Envelope> diff --git a/tools/cloud-init/vmware/90_dpkg.cfg b/tools/cloud-init/vmware/90_dpkg.cfg new file mode 100644 index 00000000..f9c9cba0 --- /dev/null +++ b/tools/cloud-init/vmware/90_dpkg.cfg @@ -0,0 +1,3 @@ +# to update this file, run dpkg-reconfigure cloud-init +datasource_list: [ OVF ] +disable_vmware_customization: false diff --git a/tools/cloud-init/vmware/config.boot.default b/tools/cloud-init/vmware/config.boot.default new file mode 100644 index 00000000..8b7cdae5 --- /dev/null +++ b/tools/cloud-init/vmware/config.boot.default @@ -0,0 +1,30 @@ +system { + host-name vyos + login { + user vyos { + authentication { + encrypted-password $6$QxPS.uk6mfo$9QBSo8u1FkH16gMyAVhus6fU3LOzvLR9Z9.82m3tiHFAxTtIkhaZSWssSgzt4v4dGAL8rhVQxTg0oAG9/q11h/ + plaintext-password "" + } + level admin + } + } + syslog { + global { + facility all { + level info + } + facility protocols { + level debug + } + } + } + config-management { + commit-revisions 100 + } +} + +interfaces { + loopback lo { + } +} |