Skip to content

Commit 077ac42

Browse files
committed
Document User Data support for System VMs
1 parent c1a1e33 commit 077ac42

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

source/adminguide/systemvm.rst

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -944,6 +944,58 @@ System VMs (any of the Console Proxy VM, Secondary Storage VM, Virtual Router or
944944
945945
Since CloudStack 4.16, for VMware, migration of System VMs can also be done to a destination host in a different cluster belonging to the same pod (in case of cluster-wide primary storage pools, this will cause the Root volume of the system VM to be migrated to the appropriate datastore in the new cluster). Storage migration of stopped System VMs is also supported.
946946
947+
Customizing System VMs
948+
----------------------
949+
950+
CloudStack can provide User Data to System VMs at boot.
951+
Root administrators can supply initialization scripts or configuration to automate tasks
952+
such as installing additional packages, setting environment variables, or configuring telemetry.
953+
Ensure that the User Data is valid for cloud-init, invalid content may prevent
954+
a System VM from functioning correctly.
955+
956+
.. warning::
957+
User Data offers powerful customization, but inappropriate or intrusive scripts can
958+
destabilise or break System VMs. Avoid modifying critical services or networking unless
959+
you fully understand the impact, and always test changes in a non-production environment
960+
before rollout.
961+
962+
To enable and configure User Data for System VMs:
963+
964+
#. Set the global setting ``systemvm.userdata.enabled`` to ``true``.
965+
#. Provide the User Data content per System VM type using the following global settings:
966+
967+
.. cssclass:: table-striped table-bordered table-hover
968+
================================= =====================================
969+
Global Setting Description
970+
================================= =====================================
971+
``consoleproxy.userdata`` User Data for Console Proxy VMs
972+
``secondarystorage.userdata`` User Data for Secondary Storage VMs
973+
``router.userdata`` User Data for Virtual Routers
974+
================================= =====================================
975+
976+
#. Destroy the System VMs and allow CloudStack to re-deploy them to apply the changes.
977+
978+
.. note::
979+
Initialization is performed by a CloudStack service, not by the systemd
980+
cloud-init unit, to avoid conflicts with CloudStack System VM services.
981+
982+
.. note::
983+
Patching a System VM does not re-run User Data. To re-execute the User Data, reboot the System VM.
984+
985+
.. note::
986+
Unlike the default cloud-init behaviour, User Data is processed on each reboot of a System VM.
987+
To achieve one-time execution, use a flag file to check if the User Data has already been executed.
988+
If the flag file exists, skip execution.
989+
990+
.. code-block:: bash
991+
992+
if [[ -f "/home/cloud/success" ]]; then
993+
echo "Already provisioned!"
994+
exit 0
995+
fi
996+
# other commands
997+
sudo touch /home/cloud/success
998+
947999
Troubleshoot networks from System VMs
9481000
-------------------------------------
9491001
.. |run-diagnostics-icon.png| image:: /_static/images/run-diagnostics-icon.png

0 commit comments

Comments
 (0)