|
| 1 | +// Module included in the following assemblies: |
| 2 | +// |
| 3 | +// * machine_management/creating_machinesets/creating-machineset-azure.adoc |
| 4 | +// * machine_management/control_plane_machine_management/cpmso_provider_configurations/cpmso-config-options-azure.adoc |
| 5 | + |
| 6 | +ifeval::["{context}" == "cpmso-config-options-azure"] |
| 7 | +:cpmso: |
| 8 | +endif::[] |
| 9 | + |
| 10 | +:_mod-docs-content-type: PROCEDURE |
| 11 | +[id="machineset-azure-capacity-reservation_{context}"] |
| 12 | += Configuring Capacity Reservation by using machine sets |
| 13 | + |
| 14 | +//Note: This is in 4.16.3, and might be backported through 4.14.z at a later date. |
| 15 | +//Earlier versions of OCP should get an update .z version here. OCP 4.17 docs should use {product-version}. |
| 16 | +{product-title} version 4.16.3 and later supports on-demand Capacity Reservation with Capacity Reservation groups on {azure-full} clusters. |
| 17 | + |
| 18 | +You can configure a machine set to deploy machines on any available resources that match the parameters of a capacity request that you define. |
| 19 | +These parameters specify the VM size, region, and number of instances that you want to reserve. |
| 20 | +If your {azure-short} subscription quota can accommodate the capacity request, the deployment succeeds. |
| 21 | + |
| 22 | +For more information, including limitations and suggested use cases for this {azure-short} instance type, see the {azure-full} documentation about link:https://learn.microsoft.com/en-us/azure/virtual-machines/capacity-reservation-overview[On-demand Capacity Reservation]. |
| 23 | + |
| 24 | +[NOTE] |
| 25 | +==== |
| 26 | +You cannot change an existing Capacity Reservation configuration for a machine set. |
| 27 | +To use a different Capacity Reservation group, you must replace the machine set and the machines that the previous machine set deployed. |
| 28 | +==== |
| 29 | + |
| 30 | +.Prerequisites |
| 31 | + |
| 32 | +* You have access to the cluster with `cluster-admin` privileges. |
| 33 | +* You installed the {oc-first}. |
| 34 | +* You created a Capacity Reservation group. |
| 35 | ++ |
| 36 | +For more information, see the {azure-full} documentation link:https://learn.microsoft.com/en-us/azure/virtual-machines/capacity-reservation-create[Create a Capacity Reservation]. |
| 37 | +
|
| 38 | +.Procedure |
| 39 | + |
| 40 | +. In a text editor, open the YAML file for an existing machine set or create a new one. |
| 41 | + |
| 42 | +. Edit the following section under the `providerSpec` field: |
| 43 | ++ |
| 44 | +-- |
| 45 | +.Sample configuration |
| 46 | +[source,yaml] |
| 47 | +---- |
| 48 | +ifndef::cpmso[] |
| 49 | +apiVersion: machine.openshift.io/v1beta1 |
| 50 | +kind: MachineSet |
| 51 | +endif::cpmso[] |
| 52 | +ifdef::cpmso[] |
| 53 | +apiVersion: machine.openshift.io/v1 |
| 54 | +kind: ControlPlaneMachineSet |
| 55 | +endif::cpmso[] |
| 56 | +# ... |
| 57 | +spec: |
| 58 | + template: |
| 59 | + spec: |
| 60 | + providerSpec: |
| 61 | + value: |
| 62 | + capacityReservationGroupID: <capacity-reservation-group> # <1> |
| 63 | +# ... |
| 64 | +---- |
| 65 | +<1> Specify the ID of the Capacity Reservation group that you want the machine set to deploy machines on. |
| 66 | +-- |
| 67 | + |
| 68 | +.Verification |
| 69 | + |
| 70 | +* To verify machine deployment, list the machines that the machine set created by running the following command: |
| 71 | ++ |
| 72 | +[source,terminal] |
| 73 | +---- |
| 74 | +ifndef::cpmso[] |
| 75 | +$ oc oc get machines.machine.openshift.io \ |
| 76 | + -n openshift-machine-api \ |
| 77 | + -l machine.openshift.io/cluster-api-machineset=<machine_set_name> |
| 78 | +endif::cpmso[] |
| 79 | +ifdef::cpmso[] |
| 80 | +$ oc get machine \ |
| 81 | + -n openshift-machine-api \ |
| 82 | + -l machine.openshift.io/cluster-api-machine-role=master |
| 83 | +endif::cpmso[] |
| 84 | +---- |
| 85 | +ifndef::cpmso[] |
| 86 | ++ |
| 87 | +where `<machine_set_name>` is the name of the compute machine set. |
| 88 | +endif::cpmso[] |
| 89 | ++ |
| 90 | +In the output, verify that the characteristics of the listed machines match the parameters of your Capacity Reservation. |
| 91 | +
|
| 92 | +ifeval::["{context}" == "cpmso-config-options-azure"] |
| 93 | +:!cpmso: |
| 94 | +endif::[] |
0 commit comments