Getting Started

Most interaction with Brightbox Cloud is through our command line interface (which uses our API). This guide will take you from creating a Brightbox Account to logging into your first Cloud Server via SSH.

Create an Account and API Client

Firstly, sign up for a Brightbox Cloud Account using Brightbox Manager. You’ll need a phone number in the country you’re registering the account to, and a valid credit card.

Once you’ve signed up, you now need to create an API Client which you’ll use to configure the CLI below. An API Client is simply a pair of access credentials for accessing the API, consisting of a client identifier (like cli-xxxxx) and a secret.

Initial setup

Installation

Now that you have an account and an API Client, you’ll need to install the cli software. Go do that and come back here. I’ll wait for you.

Configuration

You can now configure the CLI with the credentials for the API client you created.

To configure the cli with these credentials, run the following command:

$ brightbox-config client_add cli-xxxxx thesecretstring
	
Using config file /home/john/.brightbox/config
Creating new api client config cli-xxxxx

Initial test

You should be able to retrieve details of your user now. Note your id as you’ll need it in a moment:

$ brightbox-users list

 id         name        email_address         accounts
-------------------------------------------------------
 usr-xxxxx  John Doe    john@example.com      1       
-------------------------------------------------------

Configuring your ssh key

You need to upload your public ssh key so that you can log into newly created servers:

$ brightbox-users update -f my-ssh-key.pub usr-xxxxx
           id: usr-xxxxx
         name: John Doe
email_address: john@example.com
     accounts: acc-xxxxx
      ssh_key: ssh-dss AAAAB3....

Building your first server

Choose an image

First, let’s choose an operating system Image to use:

$ brightbox-images list 
	
 id         owner      type      created_on  status   size   name                                       
---------------------------------------------------------------------------------------------------------
 img-3rb1e  brightbox  official  2011-04-19  public   0      Blank disk image (i686)                    
 img-715uq  brightbox  official  2011-04-19  public   0      Blank disk image (x86_64)                  
 img-adtke  brightbox  official  2011-07-20  public   0      Blank disk image (compat) (i686)           
 img-ztdma  brightbox  official  2011-07-20  public   0      Blank disk image (compat) (x86_64)         
 img-99q79  brightbox  official  2010-10-02  public   10244  CentOS 5.5 server (i686)                   
 img-pnqnc  brightbox  official  2010-10-03  public   10240  CentOS 5.5 server (x86_64)                 
 img-qjuex  brightbox  official  2010-10-14  public   10244  Fedora 14 Beta Base (i686)                 
 img-vyeeg  brightbox  official  2010-10-15  public   10244  Fedora 14 Beta Base (x86_64)               
 img-1okdf  brightbox  official  2010-11-19  public   20480  FreeBSD 8.1 minimal (i686)                 
 img-aoubd  brightbox  official  2010-11-19  public   20480  FreeBSD 8.1 minimal (x86_64)               
 img-ofzk3  brightbox  official  2012-01-18  public   769    Ubuntu Lucid 10.04 LTS server (i686)       
 img-jrob7  brightbox  official  2012-01-18  public   769    Ubuntu Lucid 10.04 LTS server (x86_64)     
 img-hg05n  brightbox  official  2012-01-18  public   769    Ubuntu Maverick 10.10 server (i686)        
 img-n862a  brightbox  official  2012-01-18  public   769    Ubuntu Maverick 10.10 server (x86_64)      
 img-m7s1g  brightbox  official  2012-01-18  public   769    Ubuntu Natty 11.04 server (i686)           
 img-2dbi8  brightbox  official  2012-01-18  public   1025   Ubuntu Natty 11.04 server (x86_64)         
 img-b0s21  brightbox  official  2012-01-18  public   1025   Ubuntu Oneiric 11.10 server (i686)         
 img-ytx00  brightbox  official  2012-01-18  public   1025   Ubuntu Oneiric 11.10 server (x86_64)       
---------------------------------------------------------------------------------------------------------

Let’s go with i686 Ubuntu Lucid 10.04 server, which is has an identifier of img-ofzk3. We’ll get the description of it, which should have some notes about how to access it once it’s booted. This username field shows that the default account is named ubuntu.

$ brightbox-images show img-ofzk3

                id: img-ofzk3
              type: official
             owner: brightbox
        created_at: 2012-01-18T06:48
            status: public
              arch: i686
              name: Ubuntu Lucid 10.04 LTS server (i686)
       description: Standard server with cloud-init
          username: ubuntu
      virtual_size: 769
         disk_size: 524
            public: true
compatibility_mode: false
          official: true
       ancestor_id: 

Create the server

Now you can create a server using that image. Give it a name of my first server so you can identify it easily later:

$ brightbox-servers create -n "my first server" img-ofzk3
	
Creating 1 'nano' (typ-4nssg) server with image Ubuntu Lucid 10.04 server (img-ofzk3)

 id         status    type  zone   created_on  image_id   cloud_ips  name           
-------------------------------------------------------------------------------------
 srv-zx1hd  creating  nano  gb1-b  2011-03-15  img-ofzk3             my first server
-------------------------------------------------------------------------------------

Note that the new server has been given the identifier srv-zx1hd.

If you wait a few moments and show the details of the new server, it should have changed status from creating to active, which means it has been built and has started up:

$ brightbox-servers show srv-zx1hd
		
             id: srv-zx1hd
         status: active
           name: my first server
     created_at: 2011-03-15T00:24
     deleted_at: 
           zone: gb1-a
           type: typ-4nssg
      type_name: Brightbox Nano Instance
    type_handle: nano
            ram: 512
          cores: 2
           disk: 10240
          image: img-ofzk3
     image_name: Ubuntu Lucid 10.04 LTS server
    private_ips: 10.146.19.166
      cloud_ips: 
   ipv6_address: 2a02:1348:14c:4f3:24:19ff:fef0:13ce
   cloud_ip_ids: 
       hostname: srv-zk1hd.gb1.brightbox.com
public_hostname: 
  ipv6_hostname: ipv6.srv-zk1hd.gb1.brightbox.com
      snapshots: 
  server_groups: grp-98v4n

Mapping a cloud IP

So now you have a server with a IPv6 address and a private IPv4 address. You can reach it straight away if you have an IPv6 Internet connection:

$ ping6 ipv6.srv-zx1hd.gb1.brightbox.com
	
PING ipv6.srv-zx1hd.gb1.brightbox.com(2a02:1348:14c:4f3:24:19ff:fef0:13ce) 56 data bytes
64 bytes from 2a02:1348:14c:4f3:24:19ff:fef0:13ce: icmp_seq=1 ttl=54 time=13.8 ms

--- ipv6.srv-qdhro.gb1.brightbox.com ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 13.876/13.876/13.876/0.000 ms

To give it a public IPv4 address, you need to map a Cloud IP to it. Firstly, create a Cloud IP on your account:

$ brightbox-cloudips create

 id         status    public_ip       server_id  interface_id  reverse_dns                            
----------------------------------------------------------------------------------------------------
 cip-3b0ha  unmapped  109.107.35.239                           cip-109-107-35-239.gb1.brightbox.com
----------------------------------------------------------------------------------------------------

Then map it to your server using the Cloud IP identifier and your server identifier:

$ brightbox-cloudips map cip-3b0ha srv-zx1hd
	
Mapping cip-3b0ha to interface int-x4kve on srv-zx1hd

 id         status  public_ip       server_id  interface_id  reverse_dns                            
--------------------------------------------------------------------------------------------------
 cip-3b0ha  mapped  109.107.35.239  srv-zx1hd  int-x4kve     cip-109-107-35-239.gb1.brightbox.com
--------------------------------------------------------------------------------------------------

Now you can log in via ssh using your ssh key. Remember, this image uses the ubuntu account by default:

$ ssh ubuntu@109.107.35.239
	
Linux srv-zx1hd 2.6.32-24-generic-pae #42-Ubuntu SMP Fri Aug 20 15:37:22 UTC 2010 i686 GNU/Linux
Ubuntu 10.04.1 LTS

ubuntu@srv-zx1hd:~$ uptime
 13:02:07 up  0:01,  1 user,  load average: 0.04, 0.01, 0.00

For convenience, there is also a dns entry for the first Cloud IP mapped to a server:

$ host public.srv-zx1hd.gb1.brightbox.com
	
public.srv-zx1hd.gb1.brightbox.com has address 109.107.35.239

Would you like to know more?

Here you installed and configured the Command Line Interface tool, created an Ubuntu server, mapped a Cloud IP to it and connected in using ssh.

You might want to learn more about Cloud IPs, discover zones or learn how to Create a snapshot.

You might also want to learn a bit about the default firewall policy, and how to change it.

Join the Mobile Infantry and save the Galaxy. Service guarantees citizenship.
.

Last updated: 03 Jul 2012 at 16:06 BST