Atom feed of this document
 

 Part II: Starting Virtual Machines

Understanding what you can do with cloud computing means you should have a grasp on the concept of virtualization. With virtualization, you can run operating systems and applications on virtual machines instead of physical computers. To use a virtual machine, you must have an image that contains all the information about which operating system to run, the user login and password, files stored on the system, and so on. Fortunately, TryStack provides images for your use.

Basically, run:

$ nova image-list
                

and look for the images available in the text that returns. Look for the ID value.

+----+--------------------------------------+--------+--------+
| ID |                 Name                 | Status | Server |
+----+--------------------------------------+--------+--------+
| 12 | natty-server-cloudimg-amd64-kernel   | ACTIVE |        |
| 13 | natty-server-cloudimg-amd64          | ACTIVE |        |
| 14 | oneiric-server-cloudimg-amd64-kernel | ACTIVE |        |
| 15 | oneiric-server-cloudimg-amd64        | ACTIVE |        |
+----+--------------------------------------+--------+--------+
                

Now get a list of the flavors you can launch:

$ nova flavor-list
                

+----+-----------+-----------+------+-----------+------+-------+-------------+
| ID |    Name   | Memory_MB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor |
+----+-----------+-----------+------+-----------+------+-------+-------------+
| 1  | m1.tiny   | 512       | 0    | N/A       | 0    | 1     |             |
| 2  | m1.small  | 2048      | 20   | N/A       | 0    | 1     |             |
| 3  | m1.medium | 4096      | 40   | N/A       | 0    | 2     |             |
| 4  | m1.large  | 8192      | 80   | N/A       | 0    | 4     |             |
| 5  | m1.xlarge | 16384     | 160  | N/A       | 0    | 8     |             |
+----+-----------+-----------+------+-----------+------+-------+-------------+
            

Create a keypair to launch the image, in a directory where you run the nova boot command later.

$ nova keypair-add mykeypair > mykeypair.pem
                

Create security group that enables public IP access for the webserver that will run WordPress for you. You can also enable port 22 for SSH.

$ nova secgroup-create openpub "Open for public"
$ nova secgroup-add-rule openpub icmp -1 -1 0.0.0.0/0 
$ nova secgroup-add-rule openpub tcp 22 22 0.0.0.0/0  
                

Next, with the ID value of the server you want to launch and the ID of the flavor you want to launch, use your credentials to start up the instance with the identifier you got by looking at the image list.

$ nova boot --image 15 --flavor 2 --key_name mykeypair --security_groups openpub testtutorial
+--------------+--------------------------------------+
|   Property   |                Value                 |
+--------------+--------------------------------------+
| accessIPv4   |                                      |
| accessIPv6   |                                      |
| adminPass    | StuacCpAr7evnz5Q                     |
| config_drive |                                      |
| created      | 2012-03-21T20:31:40Z                 |
| flavor       | m1.small                             |
| hostId       |                                      |
| id           | 1426                                 |
| image        | oneiric-server-cloudimg-amd64        |
| key_name     | testkey2                             |
| metadata     | {}                                   |
| name         | testtut                              |
| progress     | 0                                    |
| status       | BUILD                                |
| tenant_id    | 296                                  |
| updated      | 2012-03-21T20:31:40Z                 |
| user_id      | facebook521113267                    |
| uuid         | be9f80e8-7b20-49e8-83cf-fa059a36c9f8 |
+--------------+--------------------------------------+
            

Now you can look at the state of the running instances by using nova list.

$ nova list
+------+----------------+--------+----------------------+
|  ID  |      Name      | Status |       Networks       |
+------+----------------+--------+----------------------+
| 1426 | testtut        | ACTIVE | internet=8.22.27.251 |
+------+----------------+--------+----------------------+
                

The instance goes from “launching” to “running” in a short time, and you should be able to connect via SSH. Look at the IP addresses so that you can connect to the instance once it starts running.

Log a bug against this page


loading table of contents...