Provision Bare Metal Servers on IBM Cloud Classic Infrastructure by Using the CLI

4 min read

An extension to the IBM documentation on how to provision bare metal servers on classic infrastructure using the IBM Cloud CLI.

Bare metal servers are single-tenant servers that are dedicated to the user on IBM Cloud and provisioned without a hypervisor. They are high-performance cloud servers that can be deployed in one or more data centers and are configurable with hourly or monthly options.

Bare metal options on IBM Cloud

IBM Cloud Bare Metal Servers provides various categories and options you can customize when provisioning. Some of these options include AMD, Intel, NVIDIA GPU, network redundancy, storage options, operating systems, monitoring, etc.

The following are the steps required to place an order using the IBM Cloud CLI. We will explain each step in further detail below:

  1. Get the bare metal server keyname you would like to provision based on the desired processor family, number of cores, drives etc.
  2. Choose the available locations for the server using the keyname from the first step.
  3. Using the same keyname from above, choose all the required and the optional values for various categories (OS, RAM, etc.) of the bare metal server.
  4. Select optional arguments (e.g., VLANID, subnets, ssh keys, etc.).
  5. Provision the bare metal server using the ibmcloud sl order place command with the values obtained from the above steps.

As a prerequisite, make sure to install and configure the IBM Cloud CLI locally.

In the following example, we are looking at the steps to provision a bare metal server of Dual Intel Xeon Processor Cascade Lake Scalable Family (4 Drives) in San Jose with the OS flavor Windows Server 2022 Standard Edition (64 bit).

1. Get the bare metal server keyname

Resources on classic infrastructure are organized into different kinds of packages. To create any classic infrastructure, we need values for two parameters: package type and package keyname. When creating a bare metal resource, the package type we use is BARE_METAL_CPU.

Using this package type, we can use the ibmcloud sl command to list all the unique package keynames available for BARE_METAL_CPU:

ibmcloud sl order package-list --package-type BARE_METAL_CPU
Using this package type, we can use the ibmcloud sl command to list all the unique package keynames available for BARE_METAL_CPU:

Figure 1

In Figure 1, for Dual Intel Xeon Processor Cascade Lake Scalable Family (4 Drives), the package keyname is DUAL_INTEL_XEON_PROCESSOR_CASCADE_LAKE_SCALABLE_FAMILY_4_DRIVES.

2. Choose from the available locations for a bare metal server

For a particular package keyname, you can list all the available locations for provisioning this bare metal server using the following command:

ibmcloud sl order package-locations DUAL_INTEL_XEON_PROCESSOR_CASCADE_LAKE_SCALABLE_FAMILY_4_DRIVES
For a particular package keyname, you can list all the available locations for provisioning this bare metal server using the following command:

Figure 2

In Figure 2, the highlighted location keyname is SANJOSE04.

3. Select values for various categories for a bare metal server

To list all the categories/options that are available while provisioning a DUAL_INTEL_XEON_PROCESSOR_CASCADE_LAKE_SCALABLE_FAMILY_4_DRIVES bare metal server, use the following command:

ibmcloud sl order category-list DUAL_INTEL_XEON_PROCESSOR_CASCADE_LAKE_SCALABLE_FAMILY_4_DRIVES
To list all the categories/options that are available while provisioning a DUAL_INTEL_XEON_PROCESSOR_CASCADE_LAKE_SCALABLE_FAMILY_4_DRIVES bare metal server, use the following command:

Figure 3

In Figure 3, the Name column has all the available categories for the DUAL_INTEL_XEON_PROCESSOR_CASCADE_LAKE_SCALABLE_FAMILY_4_DRIVES bare metal server, and the Category Code column has the respective category codes. The Is Required column denotes if the category is mandatory or not. For the mandatory categories, respective values must be passed as an argument when placing the bare metal order.

To list all the available options and their description for all the categories (e.g., server, OS, bandwidth, etc.) for the package name DUAL_INTEL_XEON_PROCESSOR_CASCADE_LAKE_SCALABLE_FAMILY_4_DRIVES, use the following command:

ibmcloud sl order item-list DUAL_INTEL_XEON_PROCESSOR_CASCADE_LAKE_SCALABLE_FAMILY_4_DRIVES
To list all the available options and their description for all the categories (e.g., server, OS, bandwidth, etc.) for the package name DUAL_INTEL_XEON_PROCESSOR_CASCADE_LAKE_SCALABLE_FAMILY_4_DRIVES, use the following command:

Figure 4

Further, to list all available options for a particular category code use the --category filter in the above command.

For example, the below command lists all available OS flavors for package name DUAL_INTEL_XEON_PROCESSOR_CASCADE_LAKE_SCALABLE_FAMILY_4_DRIVES:

ibmcloud sl order item-list DUAL_INTEL_XEON_PROCESSOR_CASCADE_LAKE_SCALABLE_FAMILY_4_DRIVES --category os
For example, the below command lists all available OS flavors for package name DUAL_INTEL_XEON_PROCESSOR_CASCADE_LAKE_SCALABLE_FAMILY_4_DRIVES:

In Figure 5, the keyname to use for the OS flavor Windows Server 2022 Standard Edition (64 bit) would be OS_WINDOWS_2022_FULL_STD_64_BIT.

4. Select optional arguments

You can use other optional arguments while provisioning a bare metal server — like assigning it to a VLAN or subnet or adding an SSH key.

The following are some command to accomplish these tasks:

  • Retrieve the VLAN ID: ibmcloud sl vlan list | grep <unique name or number of your VLAN>
  • Retrieve the SUBNET ID: ibmcloud sl subnet list
  • Retrieve the SSH Key IDs: ibmcloud sl security sshkey-list

Step 5 shows how to add the above example arguments.

5. Place an order

To verify a bare metal server order before you initiate it, use the –-verify argument:

ibmcloud sl order place PACKAGE_KEYNAME LOCATION ORDER_ITEM1,ORDER_ITEM2,ORDER_ITEM3,ORDER_ITEM4... [OPTIONS] –verify

To place a bare metal server order, use the following command:

ibmcloud sl order place PACKAGE_KEYNAME LOCATION ORDER_ITEM1,ORDER_ITEM2,ORDER_ITEM3,ORDER_ITEM4... [OPTIONS]

The following is an example command to order a monthly DUAL_INTEL_XEON_PROCESSOR_CASCADE_LAKE_SCALABLE_FAMILY_4_ bare metal server in Dallas with values for different categories:

ibmcloud sl order place DUAL_INTEL_XEON_PROCESSOR_CASCADE_LAKE_SCALABLE_FAMILY_4_DRIVES  DALLAS13  INTEL_XEON_4210_2_20,RAM_32_GB_DDR4_2133_ECC_NON_REG,OS_DEBIAN_10_X_BUSTER_MINIMAL_64_BIT,1_GBPS_REDUNDANT_PUBLIC_PRIVATE_NETWORK_UPLINKS,DISK_CONTROLLER_RAID,HARD_DRIVE_2_00_TB_SATA_2,HARD_DRIVE_2_00_TB_SATA_2,BANDWIDTH_1000_GB,REBOOT_KVM_OVER_IP,1_IP_ADDRESS,UNLIMITED_SSL_VPN_USERS_1_PPTP_VPN_USER_PER_ACCOUNT,NOTIFICATION_EMAIL_AND_TICKET,MONITORING_HOST_PING,AUTOMATED_NOTIFICATION --complex-type SoftLayer_Container_Product_Order_Hardware_Server --extras '{"hardware":[{"hostname":"c-test","domain":"ctest.com","primaryBackendNetworkComponent": {"networkVlan": {"primarySubnet":{"id": 123456}}},"primaryNetworkComponent": {"networkVlan": {"id": 23456}}}],"storageGroups":[{"arrayTypeId": 2,"arraySize": 2000,"hardDrives": [0,1],"partitionTemplateId": 1}],"sshKeys": [{"sshKeyIds":[123,456]}],"provisionScripts": ["https://pastebin.com/raw/SCp607Tm"]}' --billing monthly

This is an example command to order an hourly bare metal server in Dallas with values for different categories:

ibmcloud sl order place BARE_METAL_SERVER DALLAS12 BANDWIDTH_0_GB_2,100_MBPS_PRIVATE_NETWORK_UPLINK,REDUNDANT_POWER_SUPPLY,OS_UBUNTU_20_04_LTS_FOCAL_FOSSA_64_BIT,UNLIMITED_SSL_VPN_USERS_1_PPTP_VPN_USER_PER_ACCOUNT,1_IP_ADDRESS,REBOOT_KVM_OVER_IP --complex-type SoftLayer_Container_Product_Order_Hardware_Server --preset 1U_2174S_64GB_2X4TB_RAID_1 --billing hourly

Add users to the bare metal server

After provisioning the bare metal server successfully, you can add or remove users who can be notified on ping failure. When a monitoring service on that hardware instance fails and the monitor is set to notify users, any users linked to that hardware instance using this service will be notified of the failure.

To create multiple user hardware notification entries:

ibmcloud  sl call-api SoftLayer_User_Customer_Notification_Hardware  createObjects --parameters '[[{"userId":1234,"hardwareId":11234},{"userId":1235,"hardwareId":1123}]]'

To delete multiple users:

ibmcloud  sl call-api SoftLayer_User_Customer_Notification_Hardware  deleteObjects --parameters '[[{"userId":1234,"hardwareId":11234,"id":23456}]]'

hardwareId is the ID of the hardware object that is to be monitored (Type: int). The id is the unique identifier for this object (Type: int). The userId is the ID of the SoftLayer_User_Customer object that represents the user to be notified on monitoring failure (Type: int).

Summary

When provisioning an IBM Cloud Bare Metal Server on Classic infrastructure, all the configurations that are available for the user in the IBM Cloud UI are also available via the IBM Cloud CLI. One advantage of using the CLI is that you can easily leverage the commands in automations/scripts to provision multiple bare metal servers with the same configuration.

Learn more about IBM Cloud Bare Metal Servers.

Be the first to hear about news, product updates, and innovation from IBM Cloud