Skip to content

Commit f949e55

Browse files
authored
Merge pull request #88248 from jeana-redhat/OSDOCS-12857-aws-capacity-res
OSDOCS-12857: AWS Capacity Blocks
2 parents 140389c + b69030f commit f949e55

File tree

6 files changed

+175
-107
lines changed

6 files changed

+175
-107
lines changed

machine_management/control_plane_machine_management/cpmso_provider_configurations/cpmso-config-options-aws.adoc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,7 @@ include::modules/machineset-creating-imds-options.adoc[leveloffset=+3]
5252
include::modules/machineset-dedicated-instances.adoc[leveloffset=+2]
5353

5454
//Creating Dedicated Instances by using machine sets
55-
include::modules/machineset-creating-dedicated-instances.adoc[leveloffset=+3]
55+
include::modules/machineset-creating-dedicated-instances.adoc[leveloffset=+3]
56+
57+
//Configuring Capacity Reservation by using machine sets
58+
include::modules/machineset-capacity-reservation.adoc[leveloffset=+2,tag=!compute]

machine_management/control_plane_machine_management/cpmso_provider_configurations/cpmso-config-options-azure.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,12 @@ include::modules/machineset-azure-trusted-launch.adoc[leveloffset=+2]
5858
//Configuring Azure confidential virtual machines by using machine sets
5959
include::modules/machineset-azure-confidential-vms.adoc[leveloffset=+2]
6060

61+
//Configuring Capacity Reservation by using machine sets
62+
include::modules/machineset-capacity-reservation.adoc[leveloffset=+2,tag=!compute]
63+
6164
// Accelerated Networking for Microsoft Azure VMs
6265
include::modules/machineset-azure-accelerated-networking.adoc[leveloffset=+2]
6366

64-
//Configuring Capacity Reservation by using machine sets
65-
include::modules/machineset-azure-capacity-reservation.adoc[leveloffset=+2]
66-
6767
//Not applicable for 4.12, possibly 4.13?
6868
//[role="_additional-resources"]
6969
//.Additional resources

machine_management/creating_machinesets/creating-machineset-aws.adoc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ include::modules/machineset-non-guaranteed-instance.adoc[leveloffset=+1]
4949
//Creating Spot Instances by using compute machine sets
5050
include::modules/machineset-creating-non-guaranteed-instances.adoc[leveloffset=+2]
5151

52+
//Configuring Capacity Reservation by using machine sets
53+
include::modules/machineset-capacity-reservation.adoc[leveloffset=+1,tag=!controlplane]
54+
5255
//Adding a GPU node to a machine set (stesmith)
5356
include::modules/nvidia-gpu-aws-adding-a-gpu-node.adoc[leveloffset=+1]
5457

machine_management/creating_machinesets/creating-machineset-azure.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ include::modules/machineset-azure-confidential-vms.adoc[leveloffset=+1]
7070
include::modules/machineset-azure-accelerated-networking.adoc[leveloffset=+1]
7171

7272
//Configuring Capacity Reservation by using machine sets
73-
include::modules/machineset-azure-capacity-reservation.adoc[leveloffset=+1]
73+
include::modules/machineset-capacity-reservation.adoc[leveloffset=+1,tag=!controlplane]
7474

7575
//Adding a GPU node to a machine set (stesmith)
7676
include::modules/nvidia-gpu-azure-adding-a-gpu-node.adoc[leveloffset=+1]

modules/machineset-azure-capacity-reservation.adoc

Lines changed: 0 additions & 102 deletions
This file was deleted.
Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
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}" == "creating-machineset-azure"]
7+
:azure:
8+
endif::[]
9+
ifeval::["{context}" == "cpmso-config-options-azure"]
10+
:azure:
11+
endif::[]
12+
ifeval::["{context}" == "creating-machineset-aws"]
13+
:aws:
14+
endif::[]
15+
ifeval::["{context}" == "cpmso-config-options-aws"]
16+
:aws:
17+
endif::[]
18+
19+
:_mod-docs-content-type: PROCEDURE
20+
[id="machineset-capacity-reservation_{context}"]
21+
ifdef::azure[= Configuring Capacity Reservation by using machine sets]
22+
ifdef::aws[= Configuring Capacity Reservations by using machine sets]
23+
24+
{product-title} version {product-version} and later supports
25+
ifdef::azure[on-demand Capacity Reservation with Capacity Reservation groups on {azure-full} clusters.]
26+
ifdef::aws[Capacity Reservations on {aws-full} clusters, including On-Demand Capacity Reservations and Capacity Blocks for ML.]
27+
28+
You can configure a machine set to deploy machines on any available resources that match the parameters of a capacity request that you define.
29+
These parameters specify the
30+
ifdef::azure[VM size,]
31+
ifdef::aws[instance type,]
32+
region, and number of instances that you want to reserve.
33+
If your
34+
ifdef::azure[{azure-short} subscription quota]
35+
ifdef::aws[Capacity Reservation]
36+
can accommodate the capacity request, the deployment succeeds.
37+
38+
For more information, including limitations and suggested use cases for this
39+
ifdef::azure[{azure-short} offering, see link:https://learn.microsoft.com/en-us/azure/virtual-machines/capacity-reservation-overview[On-demand Capacity Reservation] in the {azure-full} documentation.]
40+
ifdef::aws[{aws-short} offering, see link:https://docs.aws.amazon.com/en_us/AWSEC2/latest/UserGuide/capacity-reservation-overview.html[On-Demand Capacity Reservations and Capacity Blocks for ML] in the {aws-short} documentation.]
41+
42+
ifdef::azure[]
43+
[NOTE]
44+
====
45+
You cannot change an existing Capacity Reservation configuration for a machine set.
46+
To use a different Capacity Reservation group, you must replace the machine set and the machines that the previous machine set deployed.
47+
====
48+
endif::azure[]
49+
50+
.Prerequisites
51+
52+
* You have access to the cluster with `cluster-admin` privileges.
53+
* You installed the {oc-first}.
54+
ifdef::azure[]
55+
* You created a Capacity Reservation group.
56+
For more information, see link:https://learn.microsoft.com/en-us/azure/virtual-machines/capacity-reservation-create[Create a Capacity Reservation] in the {azure-full} documentation.
57+
endif::azure[]
58+
ifdef::aws[]
59+
* You purchased an On-Demand Capacity Reservation or Capacity Block for ML.
60+
For more information, see link:https://docs.aws.amazon.com/en_us/AWSEC2/latest/UserGuide/capacity-reservation-overview.html[On-Demand Capacity Reservations and Capacity Blocks for ML] in the {aws-short} documentation.
61+
endif::aws[]
62+
63+
.Procedure
64+
65+
. In a text editor, open the YAML file for an existing machine set or create a new one.
66+
67+
. Edit the following section under the `providerSpec` field:
68+
+
69+
--
70+
.Sample configuration
71+
[source,yaml]
72+
----
73+
tag::compute[]
74+
apiVersion: machine.openshift.io/v1beta1
75+
kind: MachineSet
76+
end::compute[]
77+
tag::controlplane[]
78+
apiVersion: machine.openshift.io/v1
79+
kind: ControlPlaneMachineSet
80+
end::controlplane[]
81+
# ...
82+
spec:
83+
template:
84+
tag::compute[]
85+
spec:
86+
providerSpec:
87+
value:
88+
ifdef::azure[]
89+
capacityReservationGroupID: <capacity_reservation_group> # <1>
90+
endif::azure[]
91+
ifdef::aws[]
92+
capacityReservationId: <capacity_reservation> # <1>
93+
marketType: <market_type> # <2>
94+
endif::aws[]
95+
end::compute[]
96+
tag::controlplane[]
97+
machines_v1beta1_machine_openshift_io:
98+
spec:
99+
providerSpec:
100+
value:
101+
ifdef::azure[]
102+
capacityReservationGroupID: <capacity_reservation_group> # <1>
103+
endif::azure[]
104+
ifdef::aws[]
105+
capacityReservationId: <capacity_reservation> # <1>
106+
marketType: <market_type> # <2>
107+
endif::aws[]
108+
end::controlplane[]
109+
# ...
110+
----
111+
<1> Specify the ID of the
112+
ifdef::azure[Capacity Reservation group]
113+
ifdef::aws[Capacity Block for ML or On-Demand Capacity Reservation]
114+
that you want the machine set to deploy machines on.
115+
ifdef::aws[]
116+
<2> Specify the market type to use.
117+
The following values are valid:
118+
`CapacityBlock`:: Use this market type with Capacity Blocks for ML.
119+
`OnDemand`:: Use this market type with On-Demand Capacity Reservations.
120+
tag::compute[]
121+
`Spot`:: Use this market type with Spot Instances.
122+
This option is not compatible with Capacity Reservations.
123+
end::compute[]
124+
endif::[]
125+
--
126+
127+
.Verification
128+
129+
* To verify machine deployment, list the machines that the machine set created by running the following command:
130+
+
131+
[source,terminal]
132+
----
133+
tag::compute[]
134+
$ oc get machines.machine.openshift.io \
135+
-n openshift-machine-api \
136+
-l machine.openshift.io/cluster-api-machineset=<machine_set_name>
137+
end::compute[]
138+
tag::controlplane[]
139+
$ oc get machine \
140+
-n openshift-machine-api \
141+
-l machine.openshift.io/cluster-api-machine-role=master
142+
end::controlplane[]
143+
----
144+
tag::compute[]
145+
+
146+
where `<machine_set_name>` is the name of the compute machine set.
147+
end::compute[]
148+
+
149+
In the output, verify that the characteristics of the listed machines match the parameters of your
150+
ifdef::azure[Capacity Reservation.]
151+
ifdef::aws[Capacity Reservation.]
152+
153+
ifeval::["{context}" == "creating-machineset-azure"]
154+
:!azure:
155+
endif::[]
156+
ifeval::["{context}" == "cpmso-config-options-azure"]
157+
:!azure:
158+
endif::[]
159+
ifeval::["{context}" == "creating-machineset-aws"]
160+
:!aws:
161+
endif::[]
162+
ifeval::["{context}" == "cpmso-config-options-aws"]
163+
:!aws:
164+
endif::[]

0 commit comments

Comments
 (0)