diff --git a/build_library/disk_layout.json b/build_library/disk_layout.json index 2a1f8827a9..ad805b728b 100644 --- a/build_library/disk_layout.json +++ b/build_library/disk_layout.json @@ -159,6 +159,12 @@ "9":{ "type":"blank" } + }, + "interoute":{ + "9":{ + "label":"ROOT", + "blocks":"33845248" + } } } } diff --git a/build_library/template_interoute.ovf b/build_library/template_interoute.ovf new file mode 100644 index 0000000000..74aeeb5cd7 --- /dev/null +++ b/build_library/template_interoute.ovf @@ -0,0 +1,109 @@ + + + + + + + + Virtual disk information + + + + The list of logical networks + + The VM Network network + + + + A virtual machine + @@NAME@@ + + The kind of installed guest operating system + + + Virtual hardware requirements + + Virtual Hardware Family + 0 + @@NAME@@ + vmx-08 + + + hertz * 10^6 + Number of Virtual CPUs + @@NUM_CPUS@@ virtual CPU(s) + 1 + 3 + @@NUM_CPUS@@ + + + byte * 2^20 + Memory Size + @@MEM_SIZE@@MB of memory + 2 + 4 + @@MEM_SIZE@@ + + + 0 + SCSI Controller + scsiController0 + 3 + lsilogic + 6 + + + 1 + IDE Controller + ideController1 + 4 + 5 + + + 0 + false + cdrom0 + 5 + 4 + 15 + + + 0 + disk0 + ovf:/disk/vmdisk1 + 6 + 3 + 17 + + + 2 + true + VM Network + E1000 ethernet adapter on "VM Network" + ethernet0 + 7 + E1000 + 10 + + + + false + video + 8 + 24 + + + false + vmci + 9 + vmware.vmci + 1 + + + + + + + + + diff --git a/build_library/vm_image_util.sh b/build_library/vm_image_util.sh index bb5b3f5c5d..85d78f9c19 100644 --- a/build_library/vm_image_util.sh +++ b/build_library/vm_image_util.sh @@ -37,6 +37,7 @@ VALID_IMG_TYPES=( niftycloud cloudsigma packet + interoute ) #list of oem package names, minus the oem- prefix @@ -57,6 +58,7 @@ VALID_OEM_PACKAGES=( niftycloud cloudsigma packet + interoute ) # Set at runtime to one of the above types @@ -258,6 +260,13 @@ IMG_cloudsigma_OEM_PACKAGE=oem-cloudsigma ## packet IMG_packet_OEM_PACKAGE=oem-packet +## interoute +IMG_interoute_DISK_FORMAT=vmdk_stream +IMG_interoute_DISK_LAYOUT=interoute +IMG_interoute_CONF_FORMAT=interoute +IMG_interoute_OEM_PACKAGE=oem-interoute +IMG_interoute_BUNDLE_FORMAT=ova + ########################################################### # Validate and set the vm type to use for the rest of the functions @@ -932,6 +941,25 @@ _write_ovf_vmware_conf() { VM_GENERATED_FILES+=( "$ovf" ) } +_write_interoute_conf() { + local vm_mem="${1:-$(_get_vm_opt MEM)}" + local vm_cpus="$(_get_vm_opt CPUS)" + local vmdk_file_size=$(du --bytes "${VM_DST_IMG}" | cut -f1) + local vmdk_capacity=$(vmdk-convert -i "${VM_DST_IMG}" | jq .capacity) + local ovf="$(_dst_path ".ovf")" + + sed "${BUILD_LIBRARY_DIR}/template_interoute.ovf" \ + -e "s/@@NAME@@/$(_dst_name)/g" \ + -e "s/@@VMDK_FILE_NAME@@/$(basename ${VM_DST_IMG})/g" \ + -e "s/@@VMDK_FILE_SIZE@@/${vmdk_file_size}/g" \ + -e "s/@@VMDK_CAPACITY@@/${vmdk_capacity}/g" \ + -e "s/@@NUM_CPUS@@/${vm_cpus}/g" \ + -e "s/@@MEM_SIZE@@/${vm_mem}/g" \ + > "${ovf}" + + VM_GENERATED_FILES+=( "$ovf" ) +} + # If this is a bundled format generate it! write_vm_bundle() { local bundle_format=$(_get_vm_opt BUNDLE_FORMAT)