Configuring node pool capacity blocks on AWS
After you create a hosted cluster, you can configure node pool capacity blocks for graphics processing unit (GPU) reservations on Amazon Web Services (AWS).
-
Create GPU reservations on AWS by running a command similar to the following example:
The zone of the GPU reservation must match your hosted cluster zone.
$ aws ec2 describe-capacity-block-offerings \ --instance-type "p4d.24xlarge"\ --instance-count "1" \ --start-date-range "$(date -u +"2025-07-21T10:14:39Z")" \ --end-date-range "$(date -u -d "2 day" +"2025-07-22T10:16:36Z")" \ --capacity-duration-hours 24 \ --output json-
--instance-typedefines the type of your AWS instance. -
--instance-countdefines your instance purchase quantity. Valid values are integers ranging from1to64. -
--start-date-rangedefines the start date range. -
--end-date-rangedefines the end date range. -
--capacity-duration-hoursdefines the duration of capacity blocks in hours.
-
-
Purchase the minimum fee capacity block by running the following command:
$ aws ec2 purchase-capacity-block \ --capacity-block-offering-id "${MIN_FEE_ID}" \ --instance-platform "Linux/UNIX"\ --tag-specifications 'ResourceType=capacity-reservation,Tags=[{Key=usage-cluster-type,Value=hypershift-hosted}]' \ --output json > "${CR_OUTPUT_FILE}"-
--capacity-block-offering-iddefines the ID of the capacity block offering. -
--instance-platformdefines the platform of your instance. -
--tag-specificationsdefines the tag for your instance.
-
-
Create an environment variable to set the capacity reservation ID by running the following command:
$ CB_RESERVATION_ID=$(jq -r '.CapacityReservation.CapacityReservationId' "${CR_OUTPUT_FILE}")Wait for a couple of minutes for the GPU reservation to become available.
-
Add a node pool to use the GPU reservation by running the following command:
$ hcp create nodepool aws \ --cluster-name <hosted_cluster_name> \ --name <node_pool_name> \ --node-count <node_pool_count> \ --instance-type <instance_type> \ --arch <arch_type> \ --release-image <release_image> \ --render > /tmp/np.yaml-
--cluster-namespecifies the name of your hosted cluster. -
--namespecifies the name of your node pool. -
--node-countdefines the node pool count, for example,1. -
--instance-typedefines the instance type, for example,p4d.24xlarge. -
--archdefines an architecture type, for example,amd64. -
--release-imagespecifies the release image you want to use.
-
-
Add the
capacityReservationsetting in yourNodePoolresource by using the following example configuration:# ... spec: arch: amd64 clusterName: cb-np-hcp management: autoRepair: false upgradeType: Replace platform: aws: instanceProfile: cb-np-hcp-dqppw-worker instanceType: p4d.24xlarge rootVolume: size: 120 type: gp3 subnet: id: subnet-00000 placement: capacityReservation: id: ${CB_RESERVATION_ID} marketType: CapacityBlocks type: AWS # ... -
Apply the node pool configuration by running the following command:
$ oc apply -f /tmp/np.yaml
-
Verify that your new node pool is created successfully by running the following command:
$ oc get np -n clustersExample outputNAMESPACE NAME CLUSTER DESIRED NODES CURRENT NODES AUTOSCALING AUTOREPAIR VERSION UPDATINGVERSION UPDATINGCONFIG MESSAGE clusters cb-np cb-np-hcp 1 1 False False 4.22.0-0.nightly-2025-06-05-224220 False False -
Verify that your new compute nodes are created in the hosted cluster by running the following command:
$ oc get nodesExample outputNAME STATUS ROLES AGE VERSION ip-10-0-132-74.ec2.internal Ready worker 17m v1.35.4 ip-10-0-134-183.ec2.internal Ready worker 4h5m v1.35.4