From Fedora Project Wiki

No edit summary
mNo edit summary
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{QA/Test_Case
{{QA/Test_Case
|description=Create a builder instance to facilitate creation of a bootable volume
|description=Boot up a builder instance to facilitate creation of a bootable volume
|setup=
|setup=
Download and register some images to use for our builder instance:
Download and register some images to use for our builder instance:


  $> wget http://launchpad.net/cirros/trunk/0.3.0/+download/cirros-0.3.0-x86_64-uec.tar.gz
  $> wget http://launchpad.net/cirros/trunk/0.3.0/+download/cirros-0.3.0-x86_64-uec.tar.gz
  $> gunzip cirros-0.3.0-x86_64-uec.tar.gz  
  $> tar zxvf cirros-0.3.0-x86_64-uec.tar.gz  
$> tar xvf cirros-0.3.0-x86_64-uec.tar
  $> glance add name=cirros-aki is_public=true container_format=aki disk_format=aki < cirros-0.3.0-x86_64-vmlinuz  
  $> glance add name=cirros-aki is_public=true container_format=aki disk_format=aki < cirros-0.3.0-x86_64-vmlinuz  
  $> glance add name=cirros-ari is_public=true container_format=ari disk_format=ari < cirros-0.3.0-x86_64-initrd  
  $> glance add name=cirros-ari is_public=true container_format=ari disk_format=ari < cirros-0.3.0-x86_64-initrd  
  $> <nowiki>glance add name=cirros-ami is_public=true container_format=ami disk_format=ami "kernel_id=$(glance index | awk '/cirros-aki/ {print $1}')" "ramdisk_id=$(glance index | awk '/cirros-ari/ {print $1}')" < cirros-0.3.0-x86_64-blank.img </nowiki>
  $> <nowiki>glance add name=cirros-ami is_public=true container_format=ami disk_format=ami \
      "kernel_id=$(glance index | awk '/cirros-aki/ {print $1}')" \
      "ramdisk_id=$(glance index | awk '/cirros-ari/ {print $1}')" < cirros-0.3.0-x86_64-blank.img </nowiki>


|actions=
|actions=
Line 15: Line 16:


  $> INSTANCE=builder
  $> INSTANCE=builder
  $> <nowiki>nova boot --flavor 1 --image $(glance index | awk '/cirros-ami/ {print $1}') $INSTANCE</nowiki>
  $> <nowiki>nova boot --flavor 1 --image $(glance index | awk '/cirros-ami/ {print $1}') --key_name nova_key $INSTANCE</nowiki>


|results=
|results=
The instance should become active:
The instance should become active:


  $> nova list
  $> watch "nova show $INSTANCE"


Capture the private IP address:
Capture the IP address:
   
   
  $> <nowiki>IP_ADDR=$(nova show $INSTANCE | awk '/private network/ {print $5}')</nowiki>
  $> <nowiki>IP_ADDR=$(nova show $INSTANCE | awk '/network/ {print $5}')</nowiki>


or allocate a floating IP as before.
or allocate a floating IP as before.
Note the user name:


  $> USER_NAME=cirros
  $> USER_NAME=cirros
Line 32: Line 35:
and check you can ssh in:
and check you can ssh in:


  $> ssh $USER@$IP_ADDR
  $> ssh -o StrictHostKeyChecking=no -i nova_key.priv $USER_NAME@$IP_ADDR
 
with the password "cubswin:)"


}}
}}

Latest revision as of 13:46, 5 October 2012

Description

Boot up a builder instance to facilitate creation of a bootable volume

Setup

Download and register some images to use for our builder instance:

$> wget http://launchpad.net/cirros/trunk/0.3.0/+download/cirros-0.3.0-x86_64-uec.tar.gz
$> tar zxvf cirros-0.3.0-x86_64-uec.tar.gz 
$> glance add name=cirros-aki is_public=true container_format=aki disk_format=aki < cirros-0.3.0-x86_64-vmlinuz 
$> glance add name=cirros-ari is_public=true container_format=ari disk_format=ari < cirros-0.3.0-x86_64-initrd 
$> glance add name=cirros-ami is_public=true container_format=ami disk_format=ami \
      "kernel_id=$(glance index | awk '/cirros-aki/ {print $1}')" \
      "ramdisk_id=$(glance index | awk '/cirros-ari/ {print $1}')" < cirros-0.3.0-x86_64-blank.img  

How to test

Boot up the instance:

$> INSTANCE=builder
$> nova boot --flavor 1 --image $(glance index | awk '/cirros-ami/ {print $1}') --key_name nova_key $INSTANCE

Expected Results

The instance should become active:

$> watch "nova show $INSTANCE"

Capture the IP address:

$> IP_ADDR=$(nova show $INSTANCE | awk '/network/ {print $5}')

or allocate a floating IP as before.

Note the user name:

$> USER_NAME=cirros

and check you can ssh in:

$> ssh -o StrictHostKeyChecking=no -i nova_key.priv $USER_NAME@$IP_ADDR