Skip to content

Add/Update UserData / Update SSH Keys / Add LDAP Note #495

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions source/adminguide/accounts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,7 @@ OpenLDAP)
- `uniquemember`
- Attribute for uniquemembers within a group.

.. note:: ``ldap.search.group.principle`` is required when using ``linkaccounttoldap``.

Once configured, on Add Account page, you will see an "Add LDAP Account" button which opens a dialog and the selected Users can be imported.

Expand All @@ -550,6 +551,7 @@ directly in CloudStack.



.. note:: this is required when using ``linkaccounttoldap``.

LDAP SSL:
~~~~~~~~~
Expand Down
40 changes: 34 additions & 6 deletions source/adminguide/virtual_machines.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1264,7 +1264,25 @@ Create an Instance Template that supports SSH Keys.
Creating the SSH Keypair
------------------------

You must make a call to the createSSHKeyPair api method. You can either
#. Log in to the CloudStack UI.

#. In the left navigation bar, click Compute --> SSH Key Pairs.

#. Click Create a SSH Key Pair.

#. In the dialog, make the following choices:

- **Name**: Any desired name for the SSH Key Pair.

- **Public key**: (Optional) Public key material of the SSH Key Pair.

.. note:: If this field is filled in, CloudStack will register the public key. If this field is left blank, CloudStack will create a new SSH key pair.

- **Domain**: (Optional) domain for the SSH Key Pair.

.. note:: If Cloudstack generates a New SSH Key Pair using a public key, it will not save the private key. When shown, be sure to save a copy of it.

You can also use the ``createSSHKeyPair`` api method to create an SSH Keypair. You can either
use the CloudStack Python API library or the curl commands to make the
call to the cloudstack api.

Expand Down Expand Up @@ -1363,11 +1381,21 @@ The -i parameter tells the ssh client to use a ssh key found at
Resetting SSH Keys
------------------

With the API command resetSSHKeyForVirtualMachine, a user can set or
reset the SSH keypair assigned to an Instance. A lost or compromised
SSH keypair can be changed, and the user can access the Instance
by using the new keypair. Just create or register a new keypair, then
call resetSSHKeyForVirtualMachine.
A lost or compromised SSH keypair can be changed, and the user can access the Instance by using the new keypair.

#. Log in to the CloudStack UI.

#. In the left navigation bar, click Compute --> Instances.

#. Choose the Instance.

#. Click on Reset SSH Key Pair button the Instance.

.. note:: The Instance must be in a Stopped state.

#. Select the SSH Key Pair(s) to add to instance

.. note:: This can also be performed via API: ``resetSSHKeyForVirtualMachine``: Resets the assigned SSH keypair for an Instance.

.. include:: virtual_machines/user-data.rst

Expand Down
37 changes: 33 additions & 4 deletions source/adminguide/virtual_machines/user-data.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,16 @@
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.


User-Data and Meta-Data
-----------------------
=======================

Users can register userdata in CloudStack and refer the registered userdata while
deploying or editing or reset userdata on an instance. The userdata content can also be
directly provided while deploying the instance. Userdata content length can be up to 32kb.

Register Userdata
-----------------

To register a new userdata:

#. Log in to the CloudStack UI.
Expand Down Expand Up @@ -123,7 +124,7 @@ Based on these override policies, "Add Instance" UI form provides relevant optio
override or append. If it is "Deny Override" then "Add Instance" will not allow adding user specific userdata

Storing and accessing userdata
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
------------------------------

HTTP GET parameters are limited to a length of 2048 bytes, but it is possible
to store larger user-data blobs by sending them in the body via HTTP POST
Expand Down Expand Up @@ -163,6 +164,34 @@ For metadata type, use one of the following:

- ``instance-id``. The instance name of the instance

Resetting UserData
------------------

#. Log in to the CloudStack UI.

#. In the left navigation bar, click Compute --> Instances.

#. Choose the Instance to reset userdata.

.. note:: The Instance must be in a stopped state.

#. Click on Reset Userdata button on the Instance.

.. note:: If the instance already has userdata applied to it, an extra dialog box will appear.

- ``Disabled`` (Default) - This will reset the userdata using the already configured values. Skip the next step.

- ``Enabled`` - Choose this to override the already configured values. Continue to next step.

#. In the dialog box, choose one of the following:

- Stored Userdata: Choose another userdata entry.

.. note:: Stored Userdata is created under Instances --> User Data

- Manual Userdata Entry: Manually provide userdata for this Instance

.. note:: This can also be performed via API: ``resetUserDataForVirtualMachine``: Resets the UserData for virtual machine.

Determining the virtual router address without DNS
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down