Using OnMetal Cloud Servers through API


Note: This article presents the steps to use if you will be using the API for your OnMetal Cloud Server. For the parallel steps to use in the Cloud Control Panel, see Using OnMetal Cloud Servers.

OnMetal allows you to boot bare metal servers via the Rackspace Cloud Servers API.

API Client Setup

If you will be screating your OnMetal Cloud server through API and do not yet have an OpenStack Nova API client set up, you must do so.

  1. Install supernova and rackspace-novaclient via pip:
        pip install supernova rackspace-novaclient
    	
  2. Once you have been granted access to OnMetal, supernova will need to be configured to work with Rackspace’s IAD region. You can do this by adding the following to ~/.supernova:
     [iad] 
     OS_AUTH_URL=https://identity.api.rackspacecloud.com/v2.0/ 
     OS_USERNAME=< Your Rackspace Username >
     OS_PASSWORD=< Your Rackspace API Key > 
     OS_TENANT_NAME=< Your Rackspace Tenant ID> 
     OS_AUTH_SYSTEM=rackspace OS_REGION_NAME=IAD
     NOVA_SERVICE_NAME=cloudServersOpenStack
    	

Note: Be sure to set the appropriate values for:

  • OS_USERNAME - your Rackspace Cloud username
  • OS_PASSWORD - your Rackspace Cloud API key, viewable under Account Settings in the Cloud Control Panel.
  • OS_TENANT_NAME - your Rackspace Cloud tenant ID. This is displayed in the menu opened when you click on your name in the Cloud Control Panel (not including the #).

IMPORTANT OnMetal Servers must be created using an SSH key pair. Thus, you should ignore the administrator password returned ba a Create Server operation because it does not allow access to the OnMetal server. For information on generating SSH Keys, see Manage SSH Key Pairs for Cloud Servers with python-novaclient.

Uploading an SSH Key

OnMetal servers do not support password-based login, so you must upload an SSH key.

supernova iad keypair-add –pub-key <path to your public key> <public key name>

For example:

supernova iad keypair-add --pub-key ~/.ssh/id_rsa.pub Russell

For information on generating SSH Keys, see Manage SSH Key Pairs for Cloud Servers with python-novaclient.

Boot your server

To boot your OnMetal server, choose an image (operating system) and a flavor (server size).

Supported Images

  • OnMetal - CentOS 7
  • OnMetal - Debian 7 (Wheezy)

Note: Other images will be available soon.

Supported Flavors

  • All flavors have a 32 GB system disk.
  • All flavors include dual 10 GigE NICs in a high availability bonded configuration and use VLAN tagging to access ServiceNet (for traffic within a Rackspace region) and PublicNet (the Internet).

Boot command

Use the following command to boot your OnMetal server.

    supernova iad boot --flavor <flavor ID> --image <image ID> --key-name <key name>
    <server name>

For example:

supernova iad boot --flavor onmetal-compute1 --image 1387253c-7735-4542-9612-26bc9ff77a9d --key-name russell onmetal-test

You should see output such as:

    +------------------------+--------------------------------------+
    | Property | Value |
    +------------------------+--------------------------------------+
    | status | BUILD |
    | updated | 2014-05-31T00:23:29Z |
    | OS-EXT-STS:task_state | scheduling |
    | key_name | russell |
    | image | OnMetal - Debian 7 (Wheezy) |
    | hostId | |
    | OS-EXT-STS:vm_state | building |
    | flavor | OnMetal I/O v1 |
    | id | a8ea2366-9e50-4604-b6ce-e3edb8750451 |
    | user_id | 83362 |
    | name | teeth5 |
    | adminPass | 6FgtaEqkapRo |
    | tenant_id | 545251 |
    | created | 2014-05-31T00:23:29Z |
    | OS-DCF:diskConfig | MANUAL |
    | accessIPv4 | |
    | accessIPv6 | |
    | progress | 0 |
    | OS-EXT-STS:power_state | 0 |
    | config_drive | |
    | metadata | {} |
    +------------------------+--------------------------------------+

Note: Although this output displays an admin password, this password is not actually used. You can safely ignore it.

The server should take around five minutes to build. You can check the status by running:

supernova iad show <instance id>

The output should look like the following example:

    +------------------------+--------------------------------------------------------------------+

    | Property | Value |
    +------------------------+--------------------------------------------------------------------+
    | status | ACTIVE |
    | updated | 2014-05-31T00:27:34Z |
    | OS-EXT-STS:task_state | None |
    | private network | 10.184.0.48 |
    | key_name | russell |
    | image | OnMetal - Debian 7 (Wheezy) (1387253c-7735-4542-9612-26bc9ff77a9d) |
    | hostId | 8a12611e45a1e15a1aec221ab05c8494524d6bf00e7fb17c5c82722a |
    | OS-EXT-STS:vm_state | active |
    | public network | 23.253.157.48 |
    | flavor | OnMetal I/O v1 (onmetal-io1) |
    | id | a8ea2366-9e50-4604-b6ce-e3edb8750451 |
    | user_id | 83362 |
    | name | teeth5 |
    | created | 2014-05-31T00:23:29Z |
    | tenant_id | 545251 |
    | OS-DCF:diskConfig | MANUAL |
    | accessIPv4 | 23.253.157.48 |
    | accessIPv6 | |
    | progress | 0 |
    | OS-EXT-STS:power_state | 1 |
    | config_drive | |
    | metadata | {} |
    +------------------------+--------------------------------------------------------------------+

Within a few minutes, the server should be assigned a public and private IP, which you will see in the output of the show command. Once the status becomes ACTIVE, the server will boot for the first time. The server will not be reachable until the network configuration is complete. This may take another few minutes.

Logging in or deleting a server

  1. Once the server has booted, use the SSH key you uploaded to log into the server:
    Note: The default user on Debian and CentOS is root.
    ssh root@<public IP>
  2. If needed, you can also delete/cancel the server.
    supernova iad delete a8ea2366-9e50-4604-b6ce-e3edb8750451
  3. Use the following command to see the list/progress.
    supernova iad list

    The output should look something like the following:

        +--------------------------------------+---------+--------+------------+-------------+---------------------------------------------+
        | ID | Name | Status | Task State | Power State | Networks |
        +--------------------------------------+---------+--------+------------+-------------+---------------------------------------------+
        | d1d58868-2b14-4fa5-b01f-e51d658556a8 | highcpu | ACTIVE | deleting | Running | public=23.253.157.105; private=10.184.0.105 |
        +--------------------------------------+---------+--------+------------+-------------+---------------------------------------------+

Note: Your server will go into “deleting” task_state. OnMetal deletes take a bit longer than virtual servers. Usually on the order of a few minutes.

Using OnMetal

The flash cards included with the OnMetal I/O flavor come unformatted. Feel free to RAID and format them however you like. For more information, see Configure flash drives in High I/O instances as Data drives.



Was this content helpful?




© 2014 Rackspace US, Inc.

Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License


See license specifics and DISCLAIMER