summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2018-12-20 17:22:45 +0000
committerKim Hagen <kim.sidney@gmail.com>2019-01-23 13:22:33 +0100
commitd7952d075666122f480f0a5820ac01dfbaa7da1a (patch)
treee77a3057f3b90bb032dd2cc386b61d7a3978fd71 /tools
parentc4da1a5cddacaa7c2a15df9170f21c3fce78fb15 (diff)
downloadvyos-cloud-init-d7952d075666122f480f0a5820ac01dfbaa7da1a.tar.gz
vyos-cloud-init-d7952d075666122f480f0a5820ac01dfbaa7da1a.zip
Vmware: Add support for the com.vmware.guestInfo OVF transport.
This adds support for reading OVF information over the 'com.vmware.guestInfo' tranport. The current implementation requires vmware-rpctool be installed in the system. LP: #1807466
Diffstat (limited to 'tools')
-rwxr-xr-xtools/ds-identify21
1 files changed, 21 insertions, 0 deletions
diff --git a/tools/ds-identify b/tools/ds-identify
index 1acfeeb9..c61f18ae 100755
--- a/tools/ds-identify
+++ b/tools/ds-identify
@@ -726,6 +726,25 @@ ovf_vmware_guest_customization() {
return 1
}
+ovf_vmware_transport_guestinfo() {
+ [ "${DI_VIRT}" = "vmware" ] || return 1
+ command -v vmware-rpctool >/dev/null 2>&1 || return 1
+ local out="" ret=""
+ out=$(vmware-rpctool "info-get guestinfo.ovfEnv" 2>&1)
+ ret=$?
+ if [ $ret -ne 0 ]; then
+ debug 1 "Running on vmware but rpctool query returned $ret: $out"
+ return 1
+ fi
+ case "$1" in
+ "<?xml"*|"<?XML"*) :;;
+ *) debug 1 "guestinfo.ovfEnv had non-xml content: $out";
+ return 1;;
+ esac
+ debug 1 "Found guestinfo transport."
+ return 0
+}
+
is_cdrom_ovf() {
local dev="$1" label="$2"
# skip devices that don't look like cdrom paths.
@@ -758,6 +777,8 @@ dscheck_OVF() {
# Azure provides ovf. Skip false positive by dis-allowing.
is_azure_chassis && return $DS_NOT_FOUND
+ ovf_vmware_transport_guestinfo && return "${DS_FOUND}"
+
# DI_ISO9660_DEVS is <device>=label,<device>=label2
# like /dev/sr0=OVF-TRANSPORT,/dev/other=with spaces
if [ "${DI_ISO9660_DEVS#${UNAVAILABLE}:}" = "${DI_ISO9660_DEVS}" ]; then