Mirantis Container Cloud (MCC) becomes part of Mirantis OpenStack for Kubernetes (MOSK)!
Now, the MOSK documentation set covers all product layers, including MOSK management (formerly Container Cloud). This means everything you need is in one place. Some legacy names may remain in the code and documentation and will be updated in future releases. The separate Container Cloud documentation site will be retired, so please update your bookmarks for continued easy access to the latest content.
Restart a bare metal host¶
You can use the MOSK management API to restart a bare metal host in Mirantis OpenStack for Kubernetes clusters. The workflow of the host restart is as follows:
Set the maintenance mode on the cluster that contains the target node.
Set the maintenance mode on the target node for OpenStack and MOSK to drain it from workloads. No new workloads will be provisioned to a host in the maintenance mode.
Use the bare metal host object to initiate a hard reboot of the bare metal server that hosts the node.
To restart a bare metal host:
Using
kubeconfigof the MOSK management cluster, access the MOSK management API and open theClusterobject for editing:kubectl -n <project-name> edit cluster <cluster-name>
Add the following field to the
specsection to set the maintenance mode on the cluster:spec: providerSpec: value: maintenance: true
Verify that the
Clusterobject status forMaintenanceisready: true:kubectl -n <project-name> get cluster <cluster-name>
Example of a negative system response:
... status: providerStatus: conditions: ... - message: 'Maintenance state of the cluster is false, expected: # true. Waiting for the cluster to enter the maintenance state' ready: false type: Maintenance ... maintenance: true
Open the required
Machineobject for editing:kubectl -n <project-name> edit machine <machine-name>
In the
spec:providerSpecsection, set the maintenance mode on the node:spec: providerSpec: value: maintenance: true
In the
annotationssection of theMachinedefinition, capture the bare metal host name connected to the machine:metadata: annotations: metal3.io/BareMetalHost: <project-name>/<host-name>
Verify that the
Machinemaintenance status istrue:status: maintenance: true
Important
Proceed with the node maintenance only after the machine switches to the maintenance mode.
Open the required bare metal host object for editing using the previously captured
<host-name>:kubectl -n <project-name> edit baremetalhostinventory <host-name>
In the
specsection, set theonlinefield tofalse:spec: online: false
Wait for the host to shut down.
In the
specsection, set theonlinefield totrue:spec: online: true
Restore the machine from the maintenance mode by deleting the previously set
maintenance: trueline from theMachineobject:kubectl -n <project-name> edit machine <machine-name>
Restore the cluster from the maintenance mode by deleting the previously set
maintenance: trueline from theClusterobject.kubectl -n <project-name> edit cluster <cluster-name>