[pve-devel] [PATCH pve-docs 1/1] Add Cloubase-init config instruction
Austin Chan
sptrsca at gmail.com
Fri Apr 12 07:29:18 CEST 2019
---
qm-cloud-init.adoc | 104 +++++++++++++++++++++++++++++++++++++++++++++++++++--
1 file changed, 102 insertions(+), 2 deletions(-)
diff --git a/qm-cloud-init.adoc b/qm-cloud-init.adoc
index 23750da..9a203c6 100644
--- a/qm-cloud-init.adoc
+++ b/qm-cloud-init.adoc
@@ -37,17 +37,25 @@ Also many Cloud-Init images assume to have a serial console, so it is
recommended to add a serial console and use it as display for those VMs.
-Preparing Cloud-Init Templates
+Preparing Cloud-Init Templates for Linux
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The first step is to prepare your VM. Basically you can use any VM.
Simply install the Cloud-Init packages inside the VM that you want to
-prepare. On Debian/Ubuntu based systems this is as simple as:
+prepare.
+
+On Debian/Ubuntu based systems this is as simple as:
----
apt-get install cloud-init
----
+On CentOS/Fedora based systems this is as simple as:
+
+---
+yum install cloud-init
+---
+
Already many distributions provide ready-to-use Cloud-Init images (provided
as `.qcow2` files), so alternatively you can simply download and
import such images. For the following example, we will use the cloud
@@ -106,6 +114,98 @@ qm template 9000
----
+Preparing Cloud-Init Templates for Linux
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Proxmox uses configdriver2 version cloudbase-init as the cloud-init services in Windows.
+
+At first you need to set these options on proxmox:
+GUI:
+- OS Type: Microsoft Windows. It's important, proxmox uses this option to set current format in cloud-init driver.
+- Serial Port: You need at least one serial port on VM. The suggest the port number is serial0
+
+Launch the "Windows Powershell" in your VM run:
+
+---
+Press: Windows + R
+Type: powershell
+---
+
+Download the cloudbase-init installation file.
+
+---
+# For Windows i386:
+C:\> Invoke-WebRequest -UseBasicParsing https://www.cloudbase.it/downloads/CloudbaseInitSetup_x86.msi -OutFile cloudbaseinit.msi
+
+# For Windows x86_64:
+C:\> Invoke-WebRequest -UseBasicParsing https://www.cloudbase.it/downloads/CloudbaseInitSetup_x64.msi -OutFile cloudbaseinit.msi
+---
+
+Then, Allow 3rd part script modify the system:
+
+---
+C:\> Set-ExecutionPolicy Unrestricted
+---
+
+Execute the installation of cloudbase-init
+
+---
+C:\> .\cloudbaseinit.msi
+---
+
+Installation tips:
+
+---
+1. In the Configuration options window, enter Administrator for Username.
+2. Ensure that Run Cloudbase-Init service as LocalSystem is not selected.
+3. Do NOT check the "Run Sysprep to create generalized image." at now.
+---
+
+Config the option in cloudbase-init.conf and cloudbase-init-unattend.conf files
+
+- cloudbase-init.conf is for auto reload the config at every boot
+- cloudbase-init-unattend.conf is for auto config at first boot
+
+---
+Locate the file in C:\Program Files\Cloudbase Solutions\Cloudbase-Init\conf\
+---
+
+.Required options in the config file of cloudbase-init
+
+`inject_user_password`: `<false | true>` ('default =' `false`)::
+
+It must be `true` if you want to enable password reset and auto reload.
+
+`first_logon_behaviour`: `<no | always | clear_text_injected_only>` ('default =' `yes`)::
+
+If this option is set to "always", the user will be forced to change the password at the next login. If it is set to "clear_text_injected_only", the user will be forced to change the password only if the password is a clear text password, coming from the metadata. The last option is "no", when the user is never forced.
+"clear_text_injected_only" is helpless, proxmox have to use plain text password in configdriver2 devices.
+
+`plugins` ::
+More detail please visit: https://cloudbase-init.readthedocs.io/en/latest/plugins.html#plugins
+cloudbaseinit.plugins.windows.createuser.CreateUserPlugin; If you didn't use `Administrator` as default user. Please only add it in unattend file.
+cloudbaseinit.plugins.common.sethostname.SetHostNamePlugin; Allow cloudbase-init to set Hostname; Suggest in add in both file;
+cloudbaseinit.plugins.windows.setuserpassword.SetUserPasswordPlugin; Let cloudbase-init to overwrite the password; Suggest in both files.
+cloudbaseinit.plugins.common.networkconfig.NetworkConfigPlugin; Configures each network adapter; Suggest in both files.
+cloudbaseinit.plugins.windows.extendvolumes.ExtendVolumesPlugin; Auto extend the disk. Suggest in both files.
+
+`metadata_services` ::
+https://cloudbase-init.readthedocs.io/en/latest/services.html#services
+Please only add `cloudbaseinit.metadata.services.configdrive.ConfigDriveService`.
+Proxmox only uses ConfigDriveService to disseminate data.
+
+Create a new section named `[config_drive]` at the end of both files and then add these info:
+---
+config_drive_raw_hhd=false
+config_drive_cdrom=true
+config_drive_vfat=false
+---
+
+Proxmox only uses the CDROM as cloud-init driver.
+
+Delete `config_drive_raw_hhd`, `config_drive_cdrom` and `config_drive_vfat` in `[DEFAULT]` section.
+
+
Deploying Cloud-Init Templates
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--
2.15.1
More information about the pve-devel
mailing list