diff options
author | zsdc <taras@vyos.io> | 2020-04-20 23:45:01 +0300 |
---|---|---|
committer | zsdc <taras@vyos.io> | 2020-04-20 23:45:01 +0300 |
commit | afca529c30e486e834ad5e98f18bfba5f40710ac (patch) | |
tree | db0aa82c17f585af7e9238153acf8c67507f3fcd | |
parent | ffd398585f441f6cc3b23e9080f48ed7fe951069 (diff) | |
download | vyos-vm-images-afca529c30e486e834ad5e98f18bfba5f40710ac.tar.gz vyos-vm-images-afca529c30e486e834ad5e98f18bfba5f40710ac.zip |
Restored ability to build an OVA image
Also:
- actualized some variables
- added more objects to cleanup to not keep garbage after playbook run
- added variable to select default boot console in GRUB
-rw-r--r-- | README.md | 7 | ||||
-rw-r--r-- | group_vars/all.yml | 3 | ||||
-rw-r--r-- | roles/cleanup-ending/tasks/main.yml | 5 | ||||
-rw-r--r-- | roles/install-grub/templates/boot/grub/grub.cfg.j2 | 4 | ||||
-rw-r--r-- | roles/install-open-vmdk/tasks/main.yml | 17 | ||||
-rw-r--r-- | roles/vmware-ova/tasks/main.yml | 52 | ||||
-rw-r--r-- | roles/vmware-ova/templates/vyos_vmware_image.ovf.j2 | 293 | ||||
-rw-r--r-- | roles/vmware-ova/vars/main.yml | 1 | ||||
-rw-r--r-- | vmware.yml | 4 |
9 files changed, 233 insertions, 153 deletions
@@ -11,6 +11,12 @@ sudo apt update sudo apt install -y ansible python ``` +If you want to build an OVA image, you also need `ovftool` from VMware. It should be downloaded from the [VMware site](https://code.vmware.com/tool/ovf). Also, you need a private key to sign an OVA file. It can be generated with the next command: + +``` +openssl req -x509 -nodes -sha256 -days 365 -newkey rsa:1024 -keyout myself.pem -out myself.pem +``` + All other requirements will be installed by ansible-playbook. @@ -29,7 +35,6 @@ You need to copy the ISO image with VyOS to /tmp/vyos.iso before running ansible - VMware ``` - ansible-playbook vmware.yml ansible-playbook vmware.yml -e vyos_vmware_private_key_path=path_to_private_key ``` diff --git a/group_vars/all.yml b/group_vars/all.yml index f718626..41ec804 100644 --- a/group_vars/all.yml +++ b/group_vars/all.yml @@ -2,7 +2,7 @@ ansible_host_key_checking: False vyos_iso_url: "" vyos_iso_local: "{{ iso_local | default('/tmp/vyos.iso') }}" -vyos_key_url: http://packages.vyos.net/vyos-release.gpg +vyos_key_url: https://downloads.vyos.io/vyos-release.gpg vyos_key_local: /tmp/vyos-release.gpg vyos_cd_root: /mnt/cdrom @@ -17,3 +17,4 @@ vyos_root_fstype: ext4 vyos_target_drive: "" vyos_raw_img: /tmp/vyos_raw_image.img +grub_console: "kvm"
\ No newline at end of file diff --git a/roles/cleanup-ending/tasks/main.yml b/roles/cleanup-ending/tasks/main.yml index 18cea29..3a84b98 100644 --- a/roles/cleanup-ending/tasks/main.yml +++ b/roles/cleanup-ending/tasks/main.yml @@ -10,3 +10,8 @@ when: - pxe is defined - pxe == "true" + +- name: Delete Release key + file: + path: "{{ vyos_key_local }}" + state: absent diff --git a/roles/install-grub/templates/boot/grub/grub.cfg.j2 b/roles/install-grub/templates/boot/grub/grub.cfg.j2 index 0440442..6cfea8f 100644 --- a/roles/install-grub/templates/boot/grub/grub.cfg.j2 +++ b/roles/install-grub/templates/boot/grub/grub.cfg.j2 @@ -1,4 +1,8 @@ +{% if grub_console == "kvm" %} +set default=0 +{% elif grub_console == "serial" %} set default=1 +{% endif %} set timeout=5 serial --unit=0 terminal_output --append serial diff --git a/roles/install-open-vmdk/tasks/main.yml b/roles/install-open-vmdk/tasks/main.yml index dedece0..8d19da4 100644 --- a/roles/install-open-vmdk/tasks/main.yml +++ b/roles/install-open-vmdk/tasks/main.yml @@ -7,14 +7,27 @@ url: https://github.com/vmware/open-vmdk/archive/master.zip dest: /tmp/master.zip when: stat_result.stat.exists == False -- name: Extract master.zip into /var/lib/foo +- name: Extract master.zip into /tmp unarchive: src: /tmp/master.zip dest: /tmp when: stat_result.stat.exists == False +- name: Build open-vmdk + become: true + make: + chdir: /tmp/open-vmdk-master/vmdk + when: stat_result.stat.exists == False - name: Install open-vmdk become: true make: - chdir: /tmp/open-vmdk-master + chdir: /tmp/open-vmdk-master/vmdk target: install when: stat_result.stat.exists == False +- name: Delete installation directory and archive + file: + path: "{{ item }}" + state: absent + loop: + - "/tmp/open-vmdk-master" + - "/tmp/master.zip" + when: stat_result.stat.exists == False diff --git a/roles/vmware-ova/tasks/main.yml b/roles/vmware-ova/tasks/main.yml index 53c4989..0146a15 100644 --- a/roles/vmware-ova/tasks/main.yml +++ b/roles/vmware-ova/tasks/main.yml @@ -2,6 +2,10 @@ command: qemu-img convert -f raw "{{ vyos_raw_img }}" -O vmdk -o adapter_type=lsilogic "{{ vyos_vmware_tmp_vmdk }}" - name: Fix vmdk with open-vmdk command: vmdk-convert "{{ vyos_vmware_tmp_vmdk }}" "{{ vyos_vmware_vmdk }}" +- name: Delete temporary image + file: + path: "{{ vyos_vmware_tmp_vmdk }}" + state: absent - name: Get vmdk_file_size shell: du --bytes "{{ vyos_vmware_vmdk }}" | cut -f1 register: vmdk_file_size @@ -26,42 +30,14 @@ copy: dest: "{{ vyos_vmware_mf }}" content: "{{ result.stdout }}" -- name: Create OVA without private key +- name: Converting the OVF to signed OVA become: false - archive: - path: - - "{{ vyos_vmware_ovf }}" - - "{{ vyos_vmware_mf }}" - - "{{ vyos_vmware_vmdk }}" - dest: "{{ vyos_vmware_ova }}" - format: tar - when: vyos_vmware_private_key_path is not defined -- name: Sign MF - shell: openssl dgst -sha256 -sign "{{ vyos_vmware_private_key_path }}" -hex "{{ vyos_vmware_mf | basename }}" | sed 's/^RSA-//' - args: - chdir: /tmp - register: signature - when: vyos_vmware_private_key_path is defined -- name: Get certificate - shell: openssl x509 -in "{{ vyos_vmware_private_key_path }}" - register: certificate - when: vyos_vmware_private_key_path is defined -- name: Create cert file for OVA - become: false - copy: - dest: "{{ vyos_vmware_cert }}" - content: | - {{ signature.stdout }} - {{ certificate.stdout }} - when: vyos_vmware_private_key_path is defined -- name: Create OVA with private key - become: false - archive: - path: - - "{{ vyos_vmware_ovf }}" - - "{{ vyos_vmware_mf }}" - - "{{ vyos_vmware_cert }}" - - "{{ vyos_vmware_vmdk }}" - dest: "{{ vyos_vmware_ova }}" - format: tar - when: vyos_vmware_private_key_path is defined + command: "ovftool --compress=9 --privateKey={{ vyos_vmware_private_key_path }} {{ vyos_vmware_ovf }} {{ vyos_vmware_ova }}" +- name: Delete temporary files for VMware + file: + path: "{{ item }}" + state: absent + loop: + - "{{ vyos_vmware_ovf }}" + - "{{ vyos_vmware_mf }}" + - "{{ vyos_vmware_vmdk }}" diff --git a/roles/vmware-ova/templates/vyos_vmware_image.ovf.j2 b/roles/vmware-ova/templates/vyos_vmware_image.ovf.j2 index c3d6145..7f58678 100644 --- a/roles/vmware-ova/templates/vyos_vmware_image.ovf.j2 +++ b/roles/vmware-ova/templates/vyos_vmware_image.ovf.j2 @@ -1,148 +1,223 @@ <?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"> +<ovf:Envelope xmlns="http://schemas.dmtf.org/ovf/envelope/1" 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"> <References> <File ovf:href="vyos_vmware_image.vmdk" ovf:id="file1" ovf:size="{{ vmdk_file_size.stdout }}"/> </References> + <ovf:NetworkSection> + <ovf:Info>The list of logical networks</ovf:Info> + <ovf:Network ovf:name="WAN"> + <ovf:Description>WAN network</ovf:Description> + </ovf:Network> + <ovf:Network ovf:name="LAN"> + <ovf:Description>LAN network</ovf:Description> + </ovf:Network> + </ovf:NetworkSection> + <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> + <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="{{ vyos_vmdk_size }}" 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 }}"/> + <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> - <NetworkSection> - <Info>The list of logical networks</Info> - <Network ovf:name="VM Network"> - <Description>The VM Network network</Description> - </Network> - </NetworkSection> - <VirtualSystem ovf:id="vm"> + <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>Sentrium S.L.</Vendor> + <Version>{{ vyos_version }}</Version> + <ProductUrl>https://www.vyos.io</ProductUrl> + <VendorUrl>https://sentrium.io/</VendorUrl> + <AppUrl/> + <Category>Appliance user Settings</Category> + <Property ovf:key="password" ovf:password="true" ovf:qualifiers="MinLen(8)" ovf:type="string" ovf:userConfigurable="true" ovf:value=""> + <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:userConfigurable="true" ovf:value=""> + <Label>Public key</Label> + <Description>The public ssh key for the appliance 'vyos' account.</Description> + </Property> + <Category>Appliance IPv4 Network Settings (WAN interface)</Category> + <Property ovf:key="local-hostname" ovf:qualifiers="MinLen(0),MaxLen(65535)" ovf:type="string" ovf:userConfigurable="true" ovf:value=""> + <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> + <Category>Appliance API Settings</Category> + <Property ovf:key="APIKEY" ovf:type="string" ovf:userConfigurable="true"> + <Label>API key</Label> + <Description>API key to access the VyOS api. If left blank the api wil not be enabled.</Description> + </Property> + <Property ovf:key="APIPORT" ovf:value="443" ovf:type="int" ovf:userConfigurable="true"> + <Label>API listening port</Label> + <Description>API port to listen on for calls. Leave blank to keep it default '443'.</Description> + </Property> + <Property ovf:key="APIDEBUG" ovf:value="false" ovf:type="boolean" ovf:userConfigurable="true"> + <Label>API debug logging</Label> + <Description>Enable API debug logging</Description> + </Property> + <Property ovf:key="user-data" ovf:type="string" ovf:userConfigurable="true" ovf:value=""> + <Label>Cloud-init User-Data</Label> + <Description>User-Data, encoded with base64.</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="96" ovf:version="6" vmw:osType="debian8_64Guest"> + <Info>The operating system installed</Info> + <Description>Debian GNU/Linux 8 (64-bit)</Description> </OperatingSystemSection> - <VirtualHardwareSection ovf:transport="com.vmware.guestInfo" ovf:required="false"> - <Info>Virtual hardware requirements</Info> + <VirtualHardwareSection ovf:required="false" ovf:transport="com.vmware.guestInfo"> + <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> + <rasd:Reservation>512</rasd:Reservation> + </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> + <rasd:Reservation>16384</rasd:Reservation> + </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> + <rasd:Reservation>32768</rasd:Reservation> </Item> <Item> - <rasd:Address>0</rasd:Address> - <rasd:Description>SCSI Controller</rasd:Description> - <rasd:ElementName>scsiController0</rasd:ElementName> - <rasd:InstanceID>3</rasd:InstanceID> - <rasd:ResourceSubType>lsilogic</rasd:ResourceSubType> + <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 - VMware Paravirtual SCSI</rasd:ElementName> + <rasd:InstanceID xmlns:rasd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">3</rasd:InstanceID> + <rasd:ResourceSubType>VirtualSCSI</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> + <rasd:AddressOnParent>0</rasd:AddressOnParent> + <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 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 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> + <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">5</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>cdrom0</rasd:ElementName> - <rasd:InstanceID>6</rasd:InstanceID> + <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">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:HostResource>ovf:/disk/vmdisk1</rasd:HostResource> + <ovf:Item> + <rasd:AddressOnParent>7</rasd:AddressOnParent> + <rasd:AutomaticAllocation>true</rasd:AutomaticAllocation> + <rasd:Connection>WAN</rasd:Connection> + <rasd:Description>NIC representing WAN</rasd:Description> + <rasd:ElementName>WAN</rasd:ElementName> <rasd:InstanceID>7</rasd:InstanceID> - <rasd:Parent>3</rasd:Parent> - <rasd:ResourceType>17</rasd:ResourceType> - </Item> - <Item> - <rasd:AddressOnParent>2</rasd:AddressOnParent> + <rasd:ResourceSubType>vmxnet3</rasd:ResourceSubType> + <rasd:ResourceType>10</rasd:ResourceType> + </ovf:Item> + <ovf:Item> + <rasd:AddressOnParent>8</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:Connection>LAN</rasd:Connection> + <rasd:Description>NIC representing LAN</rasd:Description> + <rasd:ElementName>LAN</rasd:ElementName> <rasd:InstanceID>8</rasd:InstanceID> - <rasd:ResourceSubType>VmxNet3</rasd:ResourceSubType> + <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> - <Item ovf:required="false"> - <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> - </Item> + </ovf: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="cpuHotRemoveEnabled" vmw:value="false"/> - <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:ExtraConfig ovf:required="false" vmw:key="sched.mem.pin" 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>{{ vyos_version }}</Version> - <Property ovf:key="instance-id" ovf:type="string" ovf:userConfigurable="true" ovf:value="id-ovf"> - <Label>A Unique Instance ID for this instance</Label> - <Description>Specifies the instance id. This is required and used to determine if the machine should take "first boot" actions</Description> - </Property> - <Property ovf:key="hostname" ovf:type="string" ovf:userConfigurable="true" ovf:value="vyos"> - <Description>Specifies the hostname for the appliance</Description> - </Property> - <Property ovf:key="seedfrom" ovf:type="string" ovf:userConfigurable="true"> - <Label>Url to seed instance data from</Label> - <Description>This field is optional, but indicates that the instance should 'seed' user-data and meta-data from the given url. If set to 'http://tinyurl.com/sm-' is given, meta-data will be pulled from http://tinyurl.com/sm-meta-data and user-data from http://tinyurl.com/sm-user-data. Leave this empty if you do not want to seed from a url.</Description> - </Property> - <Property ovf:key="public-keys" ovf:type="string" ovf:userConfigurable="true" ovf:value=""> - <Label>ssh public keys</Label> - <Description>This field is optional, but indicates that the instance should populate the default user's 'authorized_keys' with this value</Description> - </Property> - <Property ovf:key="user-data" ovf:type="string" ovf:userConfigurable="true" ovf:value=""> - <Label>Encoded user-data</Label> - <Description>In order to fit into a xml attribute, this value is base64 encoded . It will be decoded, and then processed normally as user-data.</Description> - <!-- The following represents '#!/bin/sh\necho "hi world"' - ovf:value="IyEvYmluL3NoCmVjaG8gImhpIHdvcmxkIgo=" - --> - </Property> - <Property ovf:key="password" ovf:type="string" ovf:userConfigurable="true" ovf:value=""> - <Label>Default User's password</Label> - <Description>If set, the default user's password will be set to this value to allow password based login. The password will be good for only a single login. If set to the string 'RANDOM' then a random password will be generated, and written to the console.</Description> - </Property> - </ProductSection> </VirtualSystem> -</Envelope> +</ovf:Envelope>
\ No newline at end of file diff --git a/roles/vmware-ova/vars/main.yml b/roles/vmware-ova/vars/main.yml index 176f25c..598f592 100644 --- a/roles/vmware-ova/vars/main.yml +++ b/roles/vmware-ova/vars/main.yml @@ -2,5 +2,4 @@ vyos_vmware_ovf: /tmp/vyos_vmware_image.ovf vyos_vmware_tmp_vmdk: /tmp/vyos_vmware_image_tmp.vmdk vyos_vmware_mf: /tmp/vyos_vmware_image.mf vyos_vmware_vmdk: /tmp/vyos_vmware_image.vmdk -vyos_vmware_ova: /tmp/vyos_vmware_image.ova vyos_vmware_cert: /tmp/vyos_vmware_image.cert @@ -6,7 +6,7 @@ vyos_platform: VMware vyos_format: ova vyos_vmdk_size: 10 - vyos_vmware_ova: /tmp/vyos_vmware_image.ova + vyos_vmware_ova: "/tmp/vyos-{{ vyos_version }}{{ ci_tag | default() }}-vmware.ova" vyos_output_img: "{{ vyos_vmware_ova }}" cloud_init: "true" cloud_init_ds_string: "{{ cloud_init_ds | default('OVF,None') }}" @@ -26,8 +26,10 @@ - install-grub - install-persistence-conf - install-cloud-init-wrapper + - fstrim - unmount-pre - unmount-all - install-open-vmdk - vmware-ova + - cleanup-ending - release |