Maintain the Bare Metal Solution environment

After your Bare Metal Solution environment is up and running, use the information included in this guide to maintain your Bare Metal Solution servers, storage, and networking.

Set up your Google Cloud project to use the Bare Metal Solution API

The Bare Metal Solution API provides many tools to let you to monitor and maintain your Bare Metal Solution environment. Typically, you only need to use this procedure the first time you use the Bare Metal Solution API. However, reuse these instructions as needed for troubleshooting purposes in case the API does not respond as expected.

  1. Assign the Bare Metal Solution Admin or Bare Metal Solution Editor predefined IAM role to your principals. To learn how to map IAM roles, see Grant an IAM role.

  2. Enable the Bare Metal Solution API in your Cloud project.

    Console

    1. Go to the Bare Metal Solution API in your Google Cloud Console dashboard. You can also search for the Bare Metal Solution API in the API Library here: APIs & Services > Library.
    2. On the Bare Metal Solution API page, click Enable.
    3. Click the Back button on your browser. If you see a green checkmark next to the words API Enabled, you can use the API.

    gcloud

    • To enable the Bare Metal Solution API through gcloud, enter your Google Cloud project ID in the following command, copy the command, paste it into the Cloud Shell prompt, and press the Enter or Return key:

       gcloud services enable baremetalsolution.googleapis.com --project=PROJECT_ID
       

  3. Allow the Cloud SDK to work with your Cloud project.

    1. In your Cloud Shell window, enter the gcloud auth login command.
      gcloud auth login
      
    2. Copy the resulting URL and paste it into a separate browser tab or window.
    3. Log in to the page by using your username associated with your Cloud project.
    4. Click Allow to enable the Cloud SDK.
    5. Copy the authorization code.
    6. Paste the code into your Cloud Shell client command line.
    7. Press the Enter or Return key.

For additional information about the general steps required to set up an API in Google Cloud, see: Getting Started with Google Cloud APIs.

Restart a Bare Metal Solution server

To power off and restart your Bare Metal Solution server, use the following steps.

Make sure you follow the API set up steps

Restarting a server requires you to enable the Bare Metal Solution API and the Cloud SDK. You also need to grant either the Bare Metal Solution Admin or Bare Metal Solution Editor IAM role. To complete the set up steps, see Set up your Google Cloud project to use the Bare Metal Solution API.

Log in to your Bare Metal Solution server to watch the server restart

  1. Open a Cloud Console window.
  2. Navigate to your jump host VM instance: Compute Engine > VM Instances
  3. Click the SSH button to connect to your jump host VM instance.
  4. To log in to your Bare Metal Solution server, enter the SSH command in the jump host command line.

    [username@instance-jump-host ~]$ ssh customeradmin@bms-ip-address>
    customeradmin@bms-ip-address's password: bms-password
    Last login: Mon Mar 15 22:43:19 2021 from bms-ip-address
    [customeradmin@BMS_SERVER_NAME ~]$
     

  5. Enter the top command to verify that the server is running. You can use this window to monitor the progress of the reboot.

Run the restart command

  1. Open the Cloud Shell window.
  2. Add your Cloud project ID, region, and Bare Metal Solution server name into the following command.

     curl -X POST \
     -H "Authorization: Bearer $(gcloud auth print-access-token)" \
     -H "X-Goog-User-Project: PROJECT_ID" \
     -H "Content-Type: application/json" \
     "https://baremetalsolution.googleapis.com/v2/projects/PROJECT_ID/locations/REGION/instances/BMS_SERVER_NAME:reset"
     

  3. Copy and paste the command into your Cloud Shell window, and press the Enter or Return key.

    Your Bare Metal Solution server restarts. The restart takes from 15 to 60 minutes to complete, depending on your server configuration.

    The output from this command provides an operations ID that you can use to check on the status of the restart. To use the operations ID and view the status, see View the status of a long-running operation.

    {
      "name": "operations/5c0c8b3f-5edc-4117-be9f-812af9740aaf"
    }
     
    While the server reboots, you cannot use ping or SSH from your jump host VM instance to reach the Bare Metal Solution server.

    After several minutes, the Bare Metal Solution server comes back online.

  4. When the server comes back online, you can successfully issue a ping or use SSH from your jump host VM instance to reach your Bare Metal Solution server.

For more information on restarting your Bare Metal Solution server, see the Bare Metal Solution API.

Manage resources in your Bare Metal Solution environment

Bare Metal Solution management APIs, gcloud commands, and the Google Cloud Console enable you to view the status of the resources in your Bare Metal Solution environment, such as servers, networking, and storage.

Make sure you set up the Bare Metal Solution API

Viewing resource status requires you to enable the Bare Metal Solution API and the Cloud SDK. You also need to grant one of the Bare Metal Solution IAM roles to your principals, such as Bare Metal Solution Admin or Bare Metal Solution Editor. To complete the API set up steps prior to managing your resources, see Set up your Google Cloud project to use the Bare Metal Solution API.

View servers in your Bare Metal Solution environment

When you issue commands to call the Bare Metal Solution management APIs, you can learn about the status of the devices in your Bare Metal Solution environment. To see current status, choose one of the following command options:

Console

You can check the status of your Bare Metal Solution servers and their associated networking and storage components in the Cloud Console.

  1. Navigate to Compute Engine > Servers.

  2. View the available information.

    Field Description Example
    Name Server name at-1234567-svr001
    Location Bare Metal Solution region asia-southeast1
    Server Type Server specifications o2-standard-32-metal
    Client IP Server IP address that connects to your Google Virtual Private Cloud 10.200.0.5
    Private IP Server IP address that connects to other Bare Metal Solution environment resources 192.168.2.5
  3. To see additional information about the server and its networking and storage capabilities, click on the Name of the server.

    • In Basic Information, you can learn if the server supports hyperthreading.
    • In Networking, you can view the network interface names, interface types (client or private), IP addresses, and MAC addresses.
    • For Storage, you can view the logical unit number (LUN) information, such as state, name, volume, size, and type. You can also see if the LUN is shareable and bootable.

gcloud

  1. To list the servers in your Bare Metal Solution environment and see their status, enter your project ID and issue the gcloud bms instances list command:

    gcloud bms instances list --project=PROJECT_ID
    

    The following output example shows information for a server, such as the server name, type, IP addresses, and state.

    NAME               PROJECT              REGION           MACHINE_TYPE          IP_ADDRESSES             STATE
    SERVER_NAME      PROJECT_ID        REGION         o2-standard-32-metal  192.168.1.1,192.168.2.1  RUNNING
    

    Additional command options include:

    • --region: View devices in a specific Google Cloud region.
    • --limit: Limit the output to show a specific number of devices
  2. To get network and storage information for a server in your Bare Metal Solution environment, enter your server name, project ID, and region, and issue the gcloud bms instances describe command:

    gcloud bms instances describe SERVER_NAME --project=PROJECT_ID --region=REGION
    

    The following output example shows an operational server with 12 LUNs, a client network of 192.168.1.1, and a private network of 192.168.2.1.

    luns:
    - bootLun: true
      name: SERVER_NAME-lun000-b1
      sizeGb: '200'
      state: READY
      storageVolume: SERVER_NAME-vol000-b1
    - name: STORAGE_DEVICE_NAME-lun001
      sizeGb: '85'
      state: READY
      storageVolume: STORAGE_DEVICE_NAME-vol001
    - name: STORAGE_DEVICE_NAME-lun002
      sizeGb: '85'
      state: READY
      storageVolume: STORAGE_DEVICE_NAME-vol001
    - name: STORAGE_DEVICE_NAME-lun003
      sizeGb: '85'
      state: READY
      storageVolume: STORAGE_DEVICE_NAME-vol001
    - name: STORAGE_DEVICE_NAME-lun004
      sizeGb: '85'
      state: READY
      storageVolume: STORAGE_DEVICE_NAME-vol001
    - name: STORAGE_DEVICE_NAME-lun005
      sizeGb: '85'
      state: READY
      storageVolume: STORAGE_DEVICE_NAME-vol001
    - name: STORAGE_DEVICE_NAME-lun006
      sizeGb: '85'
      state: READY
      storageVolume: STORAGE_DEVICE_NAME-vol001
    - name: STORAGE_DEVICE_NAME-lun007
      sizeGb: '85'
      state: READY
      storageVolume: STORAGE_DEVICE_NAME-vol001
    - name: STORAGE_DEVICE_NAME-lun008
      sizeGb: '85'
      state: READY
      storageVolume: STORAGE_DEVICE_NAME-vol001
    - name: STORAGE_DEVICE_NAME-lun009
      sizeGb: '85'
      state: READY
      storageVolume: STORAGE_DEVICE_NAME-vol001
    - name: STORAGE_DEVICE_NAME-lun010
      sizeGb: '85'
      state: READY
      storageVolume: STORAGE_DEVICE_NAME-vol001
    - name: STORAGE_DEVICE_NAME-lun011
      sizeGb: '85'
      state: READY
      storageVolume: STORAGE_DEVICE_NAME-vol001
    - name: STORAGE_DEVICE_NAME-lun012
      sizeGb: '85'
      state: READY
      storageVolume: STORAGE_DEVICE_NAME-vol001
    machineType: o2-standard-32-metal
    name: projects/PROJECT_ID/locations/REGION/instances/SERVER_NAME
    networks:
    - ipAddress: 192.168.1.1
      macAddress:
      - 34:80:0D:52:AF:28
      - 34:80:0D:15:3E:0D
      network: STORAGE_DEVICE_NAME-vlan001
    - ipAddress: 192.168.2.1
      macAddress:
      - 34:80:0D:52:AF:38
      - 34:80:0D:15:3E:1D
      network: STORAGE_DEVICE_NAME-vlan002
    state: RUNNING
    

API

  1. Open a Cloud Shell terminal window in your Google Cloud Console.

  2. To list the servers in your Bare Metal Solution environment and see their status, enter your project ID and region into the following curl command, copy the command, paste it into the Cloud Shell prompt, and press the Enter or Return key:

    curl -X GET \
    -H "Authorization: Bearer $(gcloud auth print-access-token)" \
    -H "Content-Type: application/json" \
    "https://baremetalsolution.googleapis.com/v2/projects/PROJECT_ID/locations/REGION/instances"
    
  3. To get network and storage information for a server in your Bare Metal Solution environment, issue the following command:

    curl -X GET \
    -H "Authorization: Bearer $(gcloud auth print-access-token)" \
    -H "Content-Type: application/json" \
    "https://baremetalsolution.googleapis.com/v2/projects/PROJECT_ID/locations/REGION/instances/SERVER_NAME"
    

View storage in your Bare Metal Solution environment

Paying attention to your storage resources in the Bare Metal Solution environment helps you determine if your servers have enough storage capacity for applications and workloads. To see status for storage, choose one of the following options:

gcloud

  1. To view all storage volumes in your Bare Metal Solution environment and see their status, enter your project ID and issue the gcloud bms volumes list command:

    gcloud bms volumes list --project=PROJECT_ID
    
    The following output example shows three storage volumes, the project ID, region, volume size and storage type.
    NAME                         PROJECT              REGION           REQUESTED_SIZE_GIB  STORAGE_TYPE  STATE
    at-1234567-svr001-vol000-b1  PROJECT_ID         REGION         200                 SSD           READY
    at-1111111-vol001            PROJECT_ID         REGION         1024                SSD           READY
    at-2222222-nfs001-vol000     PROJECT_ID         REGION         400                 HDD           READY
    
  2. To view a single storage volume, enter your storage volume name, project ID, and region, and issue the gcloud bms volumes describe command:

    gcloud bms volumes describe VOLUME_NAME --project=PROJECT_ID --region=REGION
    
    The following output example shows the storage volume size, name, snapshot auto deletion policy, state, and storage type.
    currentSizeGib: '250'
    name: projects/PROJECT_ID/locations/REGION/volumes/VOLUME_NAME
    requestedSizeGib: '250'
    snapshotAutoDeleteBehavior: OLDEST_FIRST
    snapshotReservationDetail:
      reservedSpaceGib: '50'
      reservedSpaceRemainingGib: '50'
    state: READY
    storageType: SSD
    
  3. To view all LUNs for your storage volume, enter your project ID, region, and storage volume name, and issue the gcloud bms volumes luns list command:

    gcloud bms volumes luns list --project=PROJECT_ID --region=REGION --volume=VOLUME_NAME
    
    The following output example shows the names of the LUNs, region, storage volume name, volume size, and the state.
    NAME                         REGION           VOLUME       SIZE_GB  STATE
    at-11111111-vol001-lun000    REGION        VOLUME_NAME 200      READY
    
  4. To view details for a single LUN, enter your project ID, region, and LUN name, and issue the gcloud bms volumes luns describe command:

    gcloud bms volumes luns describe LUN_NAME --project=PROJECT_ID --region=REGION --volume=VOLUME_NAME
    
    The following output example shows the LUN name and storage volume information, such as size, state, storage type, name, and ID.
    bootLun: true
    name: projects/PROJECT_ID/locations/REGION/volumes/VOLUME_NAME/luns/LUN_NAME
    sizeGb: '200'
    state: READY
    storageType: SSD
    storageVolume: VOLUME_NAME
    wwid: 600a09803831434434244f774d616b94
    

API

  1. Open a Cloud Shell terminal window in your Cloud Console.

  2. To view all storage volumes in your Bare Metal Solution environment and see their status, enter your project ID and region into the following curl command. Copy the command, paste it into the Cloud Shell prompt, and press the Enter or Return key:

    curl -X GET \
    -H "Authorization: Bearer $(gcloud auth print-access-token)" \
    -H "X-Goog-User-Project: PROJECT_ID" \
    -H "Content-Type: application/json" \
    "https://baremetalsolution.googleapis.com/v2/projects/PROJECT_ID/locations/REGION/volumes"
    
  3. To view a single storage volume, enter your project ID, region, and storage volume name and issue the following command:

    curl -X GET \
    -H "Authorization: Bearer $(gcloud auth print-access-token)" \
    -H "X-Goog-User-Project: PROJECT_ID" \
    -H "Content-Type: application/json" \
    "https://baremetalsolution.googleapis.com/v2/projects/PROJECT_ID/locations/REGION/volumes/VOLUME_NAME"
    
  4. To view all logical unit numbers (LUNs) for your storage volume, enter your project ID, region, and storage volume name, then issue the following command:

    curl -X GET \
    -H "Authorization: Bearer $(gcloud auth print-access-token)" \
    -H "X-Goog-User-Project: PROJECT_ID" \
    -H "Content-Type: application/json" \
    "https://baremetalsolution.googleapis.com/v2/projects/PROJECT_ID/locations/REGION/volumes/VOLUME_NAME/luns
    
  5. To view details for a single LUN, enter your project ID, region, storage volume name, and LUN name and issue the following command:

    curl -X GET \
    -H "Authorization: Bearer $(gcloud auth print-access-token)" \
    -H "X-Goog-User-Project: PROJECT_ID" \
    -H "Content-Type: application/json" \
    "https://baremetalsolution.googleapis.com/v2/projects/PROJECT_ID/locations/REGION/volumes/VOLUME_NAME/luns/LUN_NAME"
    

View networks in your Bare Metal Solution environment

Monitoring your network resources in the Bare Metal Solution environment lets you know how your servers connect to other resources. To see the status for networking, choose one of the following options:

gcloud

  1. To view all networks in your Bare Metal Solution environment and see their status, enter your project ID and issue the gcloud bms networks list command.

    gcloud bms networks list --project=PROJECT_ID
    
    The following output example shows a network name, region, IP address range, network type, and VLAN ID for each network.
    NAME                REGION           RANGE           TYPE     VLAN_ID
    at-1111111-vlan001  REGION         192.168.1.0/24  CLIENT   122
    at-1111111-vlan002  REGION         192.168.2.0/24  PRIVATE  123
    
  2. To view details for a single network, enter the project ID, region, and network name, and issue the gcloud bms networks describe command:

    gcloud bms networks describe NETWORK_NAME --project=PROJECT_ID --region=REGION
    
    The following output example shows the IP address range, network name, state, network type, VLAN ID, and virtual routing and forwarding (VRF) details.
    cidr: 192.168.1.0/24
    name: projects/PROJECT_ID/locations/REGION/networks/NETWORK_NAME
    state: PROVISIONED
    type: CLIENT
    vlanId: '122'
    vrf:
      autonomousSystemNumber: '65500'
      juniperAlias: g00000-at-1111111-ic001
      name: at-1111111-ic001
      routeTarget: '282'
      state: PROVISIONED
    

API

  1. Open a Cloud Shell terminal window in your Cloud Console.

  2. To view all networks in your Bare Metal Solution environment and see their status, enter your project ID and region into the following curl command. Copy the command, paste it into the Cloud Shell prompt, and press the Enter or Return key:

    curl -X GET \
    -H "Authorization: Bearer $(gcloud auth print-access-token)" \
    -H "X-Goog-User-Project: PROJECT_ID" \
    -H "Content-Type: application/json" \
    "https://baremetalsolution.googleapis.com/v2/projects/PROJECT_ID/locations/REGION/networks"
    
  3. To view details for a single network, enter your project ID, region, and network name and issue the following command:

    curl -X GET \
    -H "Authorization: Bearer $(gcloud auth print-access-token)" \
    -H "X-Goog-User-Project: PROJECT_ID" \
    -H "Content-Type: application/json" \
    "https://baremetalsolution.googleapis.com/v2/projects/PROJECT_ID/locations/REGION/networks/NETWORK_NAME
    

View the status of a long-running operation

If you enter a command or API call, and the request takes a long time, you can check the status of the operation with the following command option:

API

  1. Open a Cloud Shell terminal window in your Cloud Console.

  2. To view the status of a long-running operation in your Bare Metal Solution environment, enter your project ID and the operation ID into the following curl command. Copy the command, paste it into the Cloud Shell prompt, and press the Enter or Return key:

    curl -X GET \\
    -H "Authorization: Bearer $(gcloud auth print-access-token)" \\
    -H "X-Goog-User-Project: PROJECT_ID" \\
    -H "Content-Type: application/json" \\
    "[https://baremetalsolution.googleapis.com/v1/operations/OPERATION_ID"
    
    When the operation completes, the **done** value appears as **true** in the output.
    {
      "name": "operations/OPERATION_ID",
      "done": true
    }