|
| 1 | +// This module is included in the following assemblies: |
| 2 | +// |
| 3 | +// * post_installation_configuration/bare-metal-configuration.adoc |
| 4 | + |
| 5 | +:_mod-docs-content-type: PROCEDURE |
| 6 | +[id="attaching-a-non-bootable-iso-to-a-bare-metal-node_{context}"] |
| 7 | += Attaching a non-bootable ISO to a bare-metal node |
| 8 | + |
| 9 | +You can attach a generic, non-bootable ISO virtual media image to a provisioned node by using the `DataImage` resource. After you apply the resource, the ISO image becomes accessible to the operating system after it has booted. This is useful for configuring a node after provisioning the operating system and before the node boots for the first time. |
| 10 | + |
| 11 | +.Prerequisites |
| 12 | + |
| 13 | +* The node must use Redfish or drivers derived from it to support this feature. |
| 14 | +* The node must be in the `Provisioned` or `ExternallyProvisioned` state. |
| 15 | +* The `name` must be the same as the name of the node defined in its `BareMetalHost` resource. |
| 16 | +* You have a valid `url` to the ISO image. |
| 17 | +
|
| 18 | +.Procedure |
| 19 | + |
| 20 | +. Create a `DataImage` resource: |
| 21 | ++ |
| 22 | +[source,yaml] |
| 23 | +---- |
| 24 | +apiVersion: metal3.io/v1alpha1 |
| 25 | +kind: DataImage |
| 26 | +metadata: |
| 27 | + name: <node_name> # <1> |
| 28 | +spec: |
| 29 | + url: "http://dataimage.example.com/non-bootable.iso" # <2> |
| 30 | +---- |
| 31 | +<1> Specify the name of the node as defined in its `BareMetalHost` resource. |
| 32 | +<2> Specify the URL and path to the ISO image. |
| 33 | + |
| 34 | +. Save the `DataImage` resource to a file by running the following command: |
| 35 | ++ |
| 36 | +[source,terminal] |
| 37 | +---- |
| 38 | +$ vim <node_name>-dataimage.yaml |
| 39 | +---- |
| 40 | + |
| 41 | +. Apply the `DataImage` resource by running the following command: |
| 42 | ++ |
| 43 | +[source,terminal] |
| 44 | +---- |
| 45 | +$ oc apply -f <node_name>-dataimage.yaml -n <node_namespace> <1> |
| 46 | +---- |
| 47 | +<1> Replace `<node_namespace>` so that the namespace matches the namespace for the `BareMetalHost` resource. For example, `openshift-machine-api`. |
| 48 | + |
| 49 | +. Reboot the node. |
| 50 | ++ |
| 51 | +[NOTE] |
| 52 | +==== |
| 53 | +You can physically reboot the node. You can also attach the `reboot.metal3.io` annotation or reset set the `online` status in the `BareMetalHost` resource. A forced reboot of the bare-metal node will change the state of the node to `NotReady` for awhile. For example, 5 minutes or more. |
| 54 | +==== |
| 55 | + |
| 56 | +. View the `DataImage` resource by running the following command: |
| 57 | ++ |
| 58 | +[source,terminal] |
| 59 | +---- |
| 60 | +$ oc get dataimage <node_name> -n openshift-machine-api -o yaml |
| 61 | +---- |
| 62 | ++ |
| 63 | +.Example output |
| 64 | +[source,yaml] |
| 65 | +---- |
| 66 | +apiVersion: v1 |
| 67 | +items: |
| 68 | +- apiVersion: metal3.io/v1alpha1 |
| 69 | + kind: DataImage |
| 70 | + metadata: |
| 71 | + annotations: |
| 72 | + kubectl.kubernetes.io/last-applied-configuration: | |
| 73 | + {"apiVersion":"metal3.io/v1alpha1","kind":"DataImage","metadata":{"annotations":{},"name":"bmh-node-1","namespace":"openshift-machine-api"},"spec":{"url":"http://dataimage.example.com/non-bootable.iso"}} |
| 74 | + creationTimestamp: "2024-06-10T12:00:00Z" |
| 75 | + finalizers: |
| 76 | + - dataimage.metal3.io |
| 77 | + generation: 1 |
| 78 | + name: bmh-node-1 |
| 79 | + namespace: openshift-machine-api |
| 80 | + ownerReferences: |
| 81 | + - apiVersion: metal3.io/v1alpha1 |
| 82 | + blockOwnerDeletion: true |
| 83 | + controller: true |
| 84 | + kind: BareMetalHost |
| 85 | + name: bmh-node-1 |
| 86 | + uid: 046cdf8e-0e97-485a-8866-e62d20e0f0b3 |
| 87 | + resourceVersion: "21695581" |
| 88 | + uid: c5718f50-44b6-4a22-a6b7-71197e4b7b69 |
| 89 | + spec: |
| 90 | + url: http://dataimage.example.com/non-bootable.iso |
| 91 | + status: |
| 92 | + attachedImage: |
| 93 | + url: http://dataimage.example.com/non-bootable.iso |
| 94 | + error: |
| 95 | + count: 0 |
| 96 | + message: "" |
| 97 | + lastReconciled: "2024-06-10T12:05:00Z" |
| 98 | +---- |
0 commit comments