summaryrefslogtreecommitdiff
path: root/cloudinit/cmd
diff options
context:
space:
mode:
authorPengpengSun <40026211+PengpengSun@users.noreply.github.com>2022-11-17 05:37:20 +0800
committerGitHub <noreply@github.com>2022-11-16 15:37:20 -0600
commitf5431e50a3b29db0ee044e7fa8a6a279d6cb14f7 (patch)
treec709919207c8ca51d45d24682548e863c24ecde8 /cloudinit/cmd
parent42f701751bc6bd3a3ccbd3930cecdad97c490038 (diff)
downloadcloud-init-git-f5431e50a3b29db0ee044e7fa8a6a279d6cb14f7.tar.gz
VMware: Move Guest Customization transport from OVF to VMware (#1573)
This change is moving VMware Guest Customization data transport to VMware datasource, the goal is to have a single datasource for VMware which is named DatasourceVMware. Besides Guest Customization data transport(by local file), VMware datasource already has other data transports, like Guestinfo Keys and environment arguments. The detailed changes are: 1. Remove Guest Customization data transport from OVF datasource. 2. Refactor Guest Customization data transport code and add them to VMware datasource, For backward compatibility, Guest Customization data transport is put ahead of the other existing data transport since OVF is ahead of VMware in datasource searching list. 3. Add instance-id support in customization configuration file, so that instance-id can be given from vSphere side, if instance-id is not given, this datasource will read it from the file /sys/class/dmi/id/product_uuid no matter what transport is. 4. Move Guest Customization detection from dscheck_OVF() to dscheck_VMmare() in ds_identify script, Guest Customization detection is ahead of the other existing data transports since OVF is ahead of VMware in datasource searching list. 5. Modify unittests according to above changes. 6. Modify both OVF and VMware datasource documents according to above changes. 7. Guestinfo OVF data transport is left to OVF datasource since it uses OVF which is same with iso9660 transport.
Diffstat (limited to 'cloudinit/cmd')
-rwxr-xr-xcloudinit/cmd/devel/net_convert.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/cloudinit/cmd/devel/net_convert.py b/cloudinit/cmd/devel/net_convert.py
index 269d72cd..eee49860 100755
--- a/cloudinit/cmd/devel/net_convert.py
+++ b/cloudinit/cmd/devel/net_convert.py
@@ -19,8 +19,8 @@ from cloudinit.net import (
sysconfig,
)
from cloudinit.sources import DataSourceAzure as azure
-from cloudinit.sources import DataSourceOVF as ovf
from cloudinit.sources.helpers import openstack
+from cloudinit.sources.helpers.vmware.imc import guestcust_util
NAME = "net-convert"
@@ -130,8 +130,12 @@ def handle_args(name, args):
json.loads(net_data)["network"]
)
elif args.kind == "vmware-imc":
- config = ovf.Config(ovf.ConfigFile(args.network_data.name))
- pre_ns = ovf.get_network_config_from_conf(config, False)
+ config = guestcust_util.Config(
+ guestcust_util.ConfigFile(args.network_data.name)
+ )
+ pre_ns = guestcust_util.get_network_data_from_vmware_cust_cfg(
+ config, False
+ )
distro_cls = distros.fetch(args.distro)
distro = distro_cls(args.distro, {}, None)