Skip to content

Commit 0dc201c

Browse files
committed
Add proxmox cidata support
Add required Proxmox cidata NoCloud config drive support. Proxmox has two types for ISO based configdrives that can be created, one for Windows, and one for non-Windows OS types. The Windows type is a configdrivev2 ISO type, that is similar but not quite the same with the OpenStack configdrive v2: the label is config-2. This change focuses on the NoCloud ISO type, that is similar but not the same with the NoCloud implementation: the label is cidata, and the file structure is as follows: ``` META_DATA -> file containing at most 3 entries, in the format key: value - instance-id, network-interfaces, hostname. NETWORK_CONFIG -> network configuration, standard format. USER_DATA -> user data, standard format. ``` The currently created Proxmox cidata ISO usage with NoCloud provider shows the following errors: ``` ERROR cloudbaseinit.plugins.common.userdataplugins.cloudconfig [-] Plugin 'manage_etc_hosts' is currently not supported ERROR cloudbaseinit.plugins.common.userdataplugins.cloudconfig [-] Plugin 'fqdn' is currently not supported ERROR cloudbaseinit.plugins.common.userdataplugins.cloudconfig [-] Plugin 'user' is currently not supported ERROR cloudbaseinit.plugins.common.userdataplugins.cloudconfig [-] Plugin 'password' is currently not supported ERROR cloudbaseinit.plugins.common.userdataplugins.cloudconfig [-] Plugin 'chpasswd' is currently not supported ERROR cloudbaseinit.plugins.common.userdataplugins.cloudconfig [-] Plugin 'package_upgrade' is currently not supported INFO cloudbaseinit.metadata.services.nocloudservice [-] V2 network metadata not found ``` The support for `manage_etc_hosts` cannot be added, as it cannot be mapped to an existing Windows feature. The support for `fqdn` can be added easily, as it is the same as the `set_hostname ` one. The support for `user` with the `default` entry cannot be added, as it cannot be mapped to an existing Windows feature. This feature is in some sense implicit. The support for `password` can be added as per https://cloudbase-init.readthedocs.io/en/latest/plugins.html#setting-password-main. The support for `chpasswd` can be added as per https://cloudbase-init.readthedocs.io/en/latest/plugins.html#setting-password-main. The support for `package_upgrade` can be added as per the https://cloudbase-init.readthedocs.io/en/latest/plugins.html#windows-auto-updates-main. The support for v2 network metadata is in progress here: cloudbase/cloudbase-init#164 Signed-off-by: Adrian Vladu <avladu@cloudbasesolutions.com>
1 parent 29f18da commit 0dc201c

4 files changed

Lines changed: 374 additions & 0 deletions

File tree

functional-tests/CloudbaseInit.Tests.ps1

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,10 @@ function prepare.nocloud {
350350
popd
351351
}
352352

353+
function prepare.proxmox {
354+
& prepare.nocloud
355+
}
356+
353357
function prepare.vmwareguest {
354358
pushd "$here/../$($env:CLOUD)"
355359
$openVpnTapAdapterMacAddress = Prepare-OpenVPNTapAdapter
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
instance-id: b5d7ad9def3de8f296d996d61614a9358b26f380
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#cloud-config
2+
hostname: avladu-test-proxmox
3+
manage_etc_hosts: true
4+
fqdn: avladu-test-proxmox.maas.local
5+
user: Admin2
6+
password: Passw0rd12354!!
7+
chpasswd:
8+
expire: False
9+
users:
10+
- default
11+
package_upgrade: true

proxmox/cloudbase-init.conf

Lines changed: 358 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,358 @@
1+
[DEFAULT]
2+
3+
debug = true
4+
logfile =
5+
#
6+
# From cloudbaseinit.conf
7+
#
8+
9+
# Allows OS reboots requested by plugins (boolean value)
10+
allow_reboot = false
11+
12+
# In case of execution as a service, specifies if the service must be gracefully
13+
# stopped before exiting (boolean value)
14+
stop_service_on_exit = false
15+
16+
# Check if there is a newer version of cloudbase-init available. If this option
17+
# is activated, a log message will be emitted if there is a newer version
18+
# available. (boolean value)
19+
#check_latest_version = false
20+
21+
# Max. number of attempts for fetching metadata in case of transient errors
22+
# (integer value)
23+
#retry_count = 5
24+
25+
# Interval between attempts in case of transient errors, expressed in seconds
26+
# (floating point value)
27+
#retry_count_interval = 4
28+
29+
# Path to "mtools" program suite, used for interacting with VFAT filesystems
30+
# (string value)
31+
mtools_path = none
32+
33+
# Path to "bsdtar", used to extract ISO ConfigDrive files (string value)
34+
#bsdtar_path = bsdtar.exe
35+
36+
# Truncates the hostname to 15 characters for Netbios compatibility (boolean
37+
# value)
38+
#netbios_host_name_compatibility = true
39+
40+
# Serial port logging settings. Format: "port,baudrate,parity,bytesize", e.g.:
41+
# "COM1,115200,N,8". Set to None (default) to disable. (string value)
42+
#logging_serial_port_settings = <None>
43+
44+
# Activates Windows automatically (boolean value)
45+
#activate_windows = false
46+
47+
# Sets the KMS product key for this operating system (boolean value)
48+
#set_kms_product_key = false
49+
50+
# Sets the AVMA product key for this operating system (boolean value)
51+
#set_avma_product_key = false
52+
53+
# The KMS host address in form <host>[:<port>], e.g: "kmshost:1688" (string
54+
# value)
55+
#kms_host = <None>
56+
57+
# Logs the operating system licensing information (boolean value)
58+
#log_licensing_info = true
59+
60+
# Enables basic authentication for the WinRM HTTPS listener (boolean value)
61+
#winrm_enable_basic_auth = true
62+
63+
# Configures the WinRM HTTP listener (boolean value)
64+
#winrm_configure_http_listener = false
65+
66+
# Configures the WinRM HTTPS listener (boolean value)
67+
#winrm_configure_https_listener = true
68+
69+
# List of volumes that need to be extended if contiguous space is available on
70+
# the disk. By default all the available volumes can be extended. Volumes must
71+
# be specified using a comma separated list of volume indexes, e.g.: "1,2" (list
72+
# value)
73+
#volumes_to_extend = <None>
74+
75+
# If not None, the SAN policy is set to the given value (string value)
76+
# Possible values:
77+
# OnlineAll - <No description provided>
78+
# OfflineAll - <No description provided>
79+
# OfflineShared - <No description provided>
80+
san_policy = OnlineAll
81+
82+
# Path location containing scripts to be executed when the plugin runs (string
83+
# value)
84+
#local_scripts_path = <None>
85+
86+
# Configures the network interfaces MTU based on the values provided via DHCP
87+
# (boolean value)
88+
#mtu_use_dhcp_config = true
89+
90+
# User to be added to the system or updated if already existing (string value)
91+
#username = Admin
92+
93+
# List of local groups to which the user specified in "username" will be added
94+
# (list value)
95+
#groups = Administrators
96+
97+
# Renames the builtin admin user instead of creating a new user (boolean value)
98+
#rename_admin_user = false
99+
100+
# The directory where the Heat configuration files must be saved (string value)
101+
#heat_config_dir = C:\cfn
102+
103+
# Enables the NTP client service (boolean value)
104+
#ntp_enable_service = true
105+
106+
# Configures NTP client time synchronization using the NTP servers provided via
107+
# DHCP (boolean value)
108+
#ntp_use_dhcp_config = false
109+
110+
# Sets the real time clock to use universal time (True) or local time (False)
111+
# (boolean value)
112+
#real_time_clock_utc = false
113+
114+
# Set the password provided in the configuration. If False or no password is
115+
# provided, a random one will be set (boolean value)
116+
#inject_user_password = true
117+
118+
# Control the behaviour of what happens at next logon. If this option is set to
119+
# `always`, then the user will be forced to change the password at next logon.
120+
# If it is set to `clear_text_injected_only`, then the user will have to change
121+
# the password only if the password is a clear text password, coming from the
122+
# metadata. The last option is `no`, when the user is never forced to change the
123+
# password. (string value)
124+
# Possible values:
125+
# clear_text_injected_only - <No description provided>
126+
# no - <No description provided>
127+
# always - <No description provided>
128+
#first_logon_behaviour = clear_text_injected_only
129+
130+
# List of enabled metadata service classes, to be tested for availability in the
131+
# provided order. The first available service will be used to retrieve metadata
132+
# (list value)
133+
metadata_services = cloudbaseinit.metadata.services.nocloudservice.NoCloudConfigDriveService
134+
135+
#,cloudbaseinit.metadata.services.ec2service.EC2Service,cloudbaseinit.metadata.services.maasservice.MaaSHttpService,cloudbaseinit.metadata.services.cloudstack.CloudStack,cloudbaseinit.metadata.services.opennebulaservice.OpenNebulaService
136+
137+
# List of enabled plugin classes, to be executed in the provided order (list
138+
# value)
139+
plugins = cloudbaseinit.plugins.common.mtu.MTUPlugin,cloudbaseinit.plugins.windows.ntpclient.NTPClientPlugin,cloudbaseinit.plugins.windows.sanpolicy.SANPolicyPlugin,cloudbaseinit.plugins.windows.displayidletimeout.DisplayIdleTimeoutConfigPlugin,cloudbaseinit.plugins.windows.bootconfig.BootStatusPolicyPlugin,cloudbaseinit.plugins.common.sethostname.SetHostNamePlugin,cloudbaseinit.plugins.windows.createuser.CreateUserPlugin,cloudbaseinit.plugins.common.sshpublickeys.SetUserSSHPublicKeysPlugin,cloudbaseinit.plugins.windows.extendvolumes.ExtendVolumesPlugin,cloudbaseinit.plugins.common.userdata.UserDataPlugin,cloudbaseinit.plugins.common.setuserpassword.SetUserPasswordPlugin,cloudbaseinit.plugins.windows.winrmlistener.ConfigWinRMListenerPlugin,cloudbaseinit.plugins.windows.winrmcertificateauth.ConfigWinRMCertificateAuthPlugin,cloudbaseinit.plugins.common.localscripts.LocalScriptsPlugin,cloudbaseinit.plugins.common.trim.TrimConfigPlugin,cloudbaseinit.plugins.common.networkconfig.NetworkConfigPlugin
140+
141+
# List of enabled userdata content plugins (list value)
142+
#user_data_plugins = cloudbaseinit.plugins.common.userdataplugins.parthandler.PartHandlerPlugin,cloudbaseinit.plugins.common.userdataplugins.cloudconfig.CloudConfigPlugin,cloudbaseinit.plugins.common.userdataplugins.cloudboothook.CloudBootHookPlugin,cloudbaseinit.plugins.common.userdataplugins.shellscript.ShellScriptPlugin,cloudbaseinit.plugins.common.userdataplugins.multipartmixed.MultipartMixedPlugin,cloudbaseinit.plugins.common.userdataplugins.heat.HeatPlugin
143+
144+
# List which contains the name of the cloud config plugins ordered by priority.
145+
# (list value)
146+
#cloud_config_plugins =
147+
148+
# Sets the RDP KeepAlive policy (boolean value)
149+
rdp_set_keepalive = true
150+
151+
# Sets the Windows BCD boot status policy (string value)
152+
# Possible values:
153+
# ignoreallfailures - <No description provided>
154+
bcd_boot_status_policy = ignoreallfailures
155+
156+
# Enables or disables the BCD auto recovery (boolean value)
157+
#bcd_enable_auto_recovery = false
158+
159+
# Sets a new random unique id on the boot disk to avoid collisions (boolean
160+
# value)
161+
#set_unique_boot_disk_id = true
162+
163+
# The idle timeout, in seconds, before powering off the display. Set 0 to leave
164+
# the display always on (integer value)
165+
display_idle_timeout = 0
166+
167+
# Labels of volumes on which a Windows page file needs to be created. E.g.:
168+
# "Temporary Storage" (list value)
169+
#page_file_volume_labels =
170+
171+
# Volume mount points on which a Windows page file needs to be created. E.g.:
172+
# "\\?\GLOBALROOT\device\Harddisk1\Partition1\" (list value)
173+
#page_file_volume_mount_points =
174+
175+
# Enables or disables TRIM delete notifications for the underlying storage
176+
# device. (boolean value)
177+
trim_enabled = true
178+
179+
# Processes the userdata content based on the type, e.g. executing a PowerShell
180+
# script (boolean value)
181+
#process_userdata = true
182+
183+
# Copies the userdata to the given file path. The path can include environment
184+
# variables that will be expanded, e.g.
185+
# "%%SYSTEMDRIVE%%\CloudbaseInit\UserData.bin" (string value)
186+
#userdata_save_path = <None>
187+
188+
# If set, enables or disables automatic operating system updates. (boolean
189+
# value)
190+
enable_automatic_updates = true
191+
192+
# Reports to the metadata service that provisioning has started (boolean value)
193+
#metadata_report_provisioning_started = false
194+
195+
# Reports to the metadata service that provisioning completed successfully or
196+
# failed (boolean value)
197+
#metadata_report_provisioning_completed = false
198+
199+
# Ephemeral disk volume label, e.g.: "Temporary Storage" (string value)
200+
#ephemeral_disk_volume_label = <None>
201+
202+
# Ephemeral disk volume mount point,
203+
# e.g.:"\\?\GLOBALROOT\device\Harddisk1\Partition1\" (string value)
204+
#ephemeral_disk_volume_mount_point = <None>
205+
206+
# Ephemeral disk data loss warning path, relative to the ephemeral disk volume
207+
# path. E.g.: DATALOSS_WARNING_README.txt (string value)
208+
#ephemeral_disk_data_loss_warning_path = <None>
209+
210+
# The length of the generated password for the user defined by the `username`
211+
# config option. (integer value)
212+
#user_password_length = 20
213+
214+
215+
[azure]
216+
217+
#
218+
# From cloudbaseinit.conf
219+
#
220+
221+
# Certificate store name for metadata certificates (string value)
222+
#transport_cert_store_name = Windows Azure Environment
223+
224+
225+
[cloudstack]
226+
227+
#
228+
# From cloudbaseinit.conf
229+
#
230+
231+
# The base URL where the service looks for metadata (string value)
232+
# Deprecated group/name - [DEFAULT]/cloudstack_metadata_ip
233+
#metadata_base_url = http://10.1.1.1/
234+
235+
# The port number used by the Password Server. (integer value)
236+
#password_server_port = 8080
237+
238+
# Whether to disable the validation of HTTPS certificates. (boolean value)
239+
#https_allow_insecure = false
240+
241+
# The path to a CA_BUNDLE file or directory with certificates of trusted CAs.
242+
# (string value)
243+
#https_ca_bundle = <None>
244+
245+
246+
[config_drive]
247+
248+
#
249+
# From cloudbaseinit.conf
250+
#
251+
252+
# DEPRECATED: Look for an ISO config drive in raw HDDs (boolean value)
253+
# Deprecated group/name - [DEFAULT]/config_drive_raw_hhd
254+
# This option is deprecated for removal.
255+
# Its value may be silently ignored in the future.
256+
raw_hdd = false
257+
258+
# DEPRECATED: Look for a config drive in the attached cdrom drives (boolean
259+
# value)
260+
# Deprecated group/name - [DEFAULT]/config_drive_cdrom
261+
# This option is deprecated for removal.
262+
# Its value may be silently ignored in the future.
263+
cdrom = true
264+
265+
# DEPRECATED: Look for a config drive in VFAT filesystems (boolean value)
266+
# Deprecated group/name - [DEFAULT]/config_drive_vfat
267+
# This option is deprecated for removal.
268+
# Its value may be silently ignored in the future.
269+
vfat = false
270+
271+
# Supported formats of a configuration drive (list value)
272+
# Deprecated group/name - [DEFAULT]/config_drive_types
273+
types = iso
274+
275+
# Supported configuration drive locations (list value)
276+
# Deprecated group/name - [DEFAULT]/config_drive_locations
277+
locations = cdrom
278+
279+
280+
[ec2]
281+
282+
#
283+
# From cloudbaseinit.conf
284+
#
285+
286+
# The base URL where the service looks for metadata (string value)
287+
# Deprecated group/name - [DEFAULT]/ec2_metadata_base_url
288+
#metadata_base_url = http://169.254.169.254/
289+
290+
# Add a route for the metadata ip address to the gateway (boolean value)
291+
# Deprecated group/name - [DEFAULT]/ec2_add_metadata_private_ip_route
292+
#add_metadata_private_ip_route = true
293+
294+
# Whether to disable the validation of HTTPS certificates. (boolean value)
295+
#https_allow_insecure = false
296+
297+
# The path to a CA_BUNDLE file or directory with certificates of trusted CAs.
298+
# (string value)
299+
#https_ca_bundle = <None>
300+
301+
302+
[maas]
303+
304+
#
305+
# From cloudbaseinit.conf
306+
#
307+
308+
# The base URL for MaaS metadata (string value)
309+
# Deprecated group/name - [DEFAULT]/maas_metadata_url
310+
#metadata_base_url = <None>
311+
312+
# The MaaS OAuth consumer key (string value)
313+
# Deprecated group/name - [DEFAULT]/maas_oauth_consumer_key
314+
#oauth_consumer_key =
315+
316+
# The MaaS OAuth consumer secret (string value)
317+
# Deprecated group/name - [DEFAULT]/maas_oauth_consumer_secret
318+
#oauth_consumer_secret =
319+
320+
# The MaaS OAuth token key (string value)
321+
# Deprecated group/name - [DEFAULT]/maas_oauth_token_key
322+
#oauth_token_key =
323+
324+
# The MaaS OAuth token secret (string value)
325+
# Deprecated group/name - [DEFAULT]/maas_oauth_token_secret
326+
#oauth_token_secret =
327+
328+
# Whether to disable the validation of HTTPS certificates. (boolean value)
329+
#https_allow_insecure = false
330+
331+
# The path to a CA_BUNDLE file or directory with certificates of trusted CAs.
332+
# (string value)
333+
#https_ca_bundle = <None>
334+
335+
336+
[openstack]
337+
338+
#
339+
# From cloudbaseinit.conf
340+
#
341+
342+
# The base URL where the service looks for metadata (string value)
343+
#metadata_base_url = http://169.254.169.254/
344+
345+
# Add a route for the metadata ip address to the gateway (boolean value)
346+
#add_metadata_private_ip_route = true
347+
348+
# Whether to disable the validation of HTTPS certificates. (boolean value)
349+
#https_allow_insecure = false
350+
351+
# The path to a CA_BUNDLE file or directory with certificates of trusted CAs.
352+
# (string value)
353+
#https_ca_bundle = <None>
354+
355+
[nocloud]
356+
357+
metadata_file = "META_DATA"
358+
userdata_file = "USER_DATA"

0 commit comments

Comments
 (0)