diff --git a/docs/en/guides/hosted-private-cloud/opcp/how-to-setup-instance-from-cli.mdx b/docs/en/guides/hosted-private-cloud/opcp/how-to-setup-instance-from-cli.mdx index 0763af9125..c3896ee50a 100644 --- a/docs/en/guides/hosted-private-cloud/opcp/how-to-setup-instance-from-cli.mdx +++ b/docs/en/guides/hosted-private-cloud/opcp/how-to-setup-instance-from-cli.mdx @@ -1,7 +1,7 @@ --- -title: How to Deploy an Instance via the OpenStack CLI +title: How to deploy an instance via the OpenStack CLI description: Find out how to deploy an OPCP instance via the OpenStack command-line interface by configuring networks, subnets, instances, and SSH keys -lastUpdated: 2026-06-16 +lastUpdated: 2026-07-20 --- ## Objective @@ -51,9 +51,9 @@ Check the OpenStack client documentation directly on the [OpenStack website](htt ::: -### Retrieve the Parameters Needed to Create an Instance +### Retrieve the parameters needed to create an instance -#### Create a Private Network and a Subnet +#### Create a private network and a subnet **Step 1: Create the Private Network** @@ -198,7 +198,7 @@ openstack subnet create --network opcpdocs --subnet-range 192.168.120.0/24 --all This subnet can be used to deploy an instance, allowing OpenStack to assign an IP address to it during installation. -#### Adding a Public SSH Key +#### Adding a public SSH key First, you need to add a public SSH key to connect to your instances. @@ -229,7 +229,7 @@ openstack keypair list +---------------+-------------------------------------------------+------+ ``` -#### List Instance Flavors +#### List instance flavors Next, retrieve the ID or name of the flavor you want to use: @@ -246,7 +246,7 @@ openstack flavor list +--------------------------------------+---------------------+---------+------+-----------+-------+-----------+ ``` -#### List Available Images +#### List available images Finally, get the ID or name of the image to use for the instance: @@ -262,7 +262,7 @@ openstack image list +--------------------------------------+-----------------------------------------------+--------+ ``` -### Instance Installation +### Instance installation With the previously gathered information, you can create an instance to deploy an operating system along with your SSH public key on the desired flavor: @@ -341,9 +341,32 @@ openstack server create --flavor $flavor_ID --image $image_ID --network $network You must ensure that the node is `Available` and has the required **traits** to deploy the desired flavor. -To check the current state of a node and retrieve its ID, you can consult our documentation: [OPCP Node Lifecycle](/guides/hosted-private-cloud/opcp/node-lifecycle). +To check the current state of a node and retrieve its ID, see the [OPCP Node Lifecycle](/guides/hosted-private-cloud/opcp/node-lifecycle) guide. -#### Deleting an Instance +#### Rebooting or stopping an instance + +You can manage your instance's power state directly through the OpenStack API: + +```bash +# Soft reboot +openstack server reboot $INSTANCE_ID + +# Hard reboot +openstack server reboot --hard $INSTANCE_ID + +# Stop the instance +openstack server stop $INSTANCE_ID + +# Start the instance +openstack server start $INSTANCE_ID +``` + +:::warning +Stopping an instance must always be done through the OpenStack API or the Horizon interface, not from within the operating system using commands such as `systemctl poweroff`. An action performed directly from the OS is not propagated to OpenStack, which would continue to consider the instance as active, leaving it in an inconsistent state between its actual status and the one known by the platform. +If a node remains stuck in an intermediate state after a shutdown performed from the OS, you can unblock it by forcing it off and then on again with the commands `openstack baremetal node power off ` and `openstack baremetal node power on `. +::: + +#### Deleting an instance You can delete an instance with the following command: diff --git a/docs/fr/guides/hosted-private-cloud/opcp/how-to-setup-instance-from-cli.mdx b/docs/fr/guides/hosted-private-cloud/opcp/how-to-setup-instance-from-cli.mdx index 78f31c58eb..fba1093a85 100644 --- a/docs/fr/guides/hosted-private-cloud/opcp/how-to-setup-instance-from-cli.mdx +++ b/docs/fr/guides/hosted-private-cloud/opcp/how-to-setup-instance-from-cli.mdx @@ -1,7 +1,7 @@ --- title: Comment installer une instance depuis la CLI OpenStack description: Découvrez comment déployer une instance OPCP via l'outil en ligne de commande OpenStack en configurant les réseaux, sous-réseaux, instances et clés SSH -lastUpdated: 2026-06-16 +lastUpdated: 2026-07-20 --- ## Objectif @@ -343,7 +343,30 @@ openstack server create --flavor $flavor_ID --image $image_ID --network $network Il faudra cependant vous assurer que le nœud a le statut `Available` et possède bien les **traits** nécessaires pour installer la flavor souhaitée. -Pour vérifier l'état actuel du nœud et récupérer son identifiant, vous pouvez consultez notre documentation : [Cycle de vie d'un nœud OPCP](/guides/hosted-private-cloud/opcp/node-lifecycle). +Pour vérifier l'état actuel du nœud et récupérer son identifiant, consultez le guide « [Cycle de vie d'un nœud OPCP](/guides/hosted-private-cloud/opcp/node-lifecycle) ». + +#### Redémarrer ou arrêter une instance + +Vous pouvez gérer l'état d'alimentation de votre instance directement depuis l'API OpenStack : + +```bash +# Redémarrage logiciel (soft reboot) +openstack server reboot $INSTANCE_ID + +# Redémarrage matériel (hard reboot) +openstack server reboot --hard $INSTANCE_ID + +# Arrêter l'instance +openstack server stop $INSTANCE_ID + +# Démarrer l'instance +openstack server start $INSTANCE_ID +``` + +:::warning +L'arrêt d'une instance doit toujours être effectué depuis l'API OpenStack ou l'interface Horizon, et non depuis le système d'exploitation via des commandes telles que `systemctl poweroff`. Une action réalisée directement depuis l'OS n'est pas propagée à OpenStack, qui continuerait de considérer l'instance comme active : elle se retrouverait dans un état incohérent entre son statut réel et celui connu par la plateforme. +Dans le cas où un nœud resterait bloqué dans un état intermédiaire après une extinction effectuée depuis l'OS, vous pouvez le débloquer en forçant son arrêt puis son démarrage avec les commandes `openstack baremetal node power off ` et `openstack baremetal node power on `. +::: #### Suppression d'une instance