Launching an Instance using an ISO Image

Metacloud supports booting instances using ISO images. First, create and boot an instance from the ISO image. After the instance is successfully launched, connect to the instance using a remote console and install the system.

To create a bootable volume from the ISO image, you must use the nova boot --block-device option with the following syntax:

   --block-device source=blank,dest=volume,size=SIZE,shutdown=preserve
Parameter Description
source= The source is blank in this example. Use the image type to specify the ISO image source.
dest= The type of the target virtual device in this example is volume.
size= The size in GB of the volume that is created. The size must be sufficient to accomodate the source.
shutdown= What to do with the volume when the instance is deleted.
preserve—does not delete the volume
remove—deletes the volume.

The following example uses the ubuntu-16.04.1-server-amd64 ISO image.

  1. Boot the instance. You must include the shutdown=preserve parameter to ensure the volume you create is not deleted when the instance is shutdown.

    $ nova boot newInstance \
       --flavor 2 \
       --image <IMAGE_ID> \
       --security-groups default \
       --nic net-id= <NETWORK_ID> \
       --block-device source=blank,dest=volume,size=10,shutdown=preserve 
          
    +--------------------------------------+-----------------------------+
    | Property                             | Value                       |
    +--------------------------------------+-----------------------------+
    | OS-DCF:diskConfig                    | MANUAL                      |
    | OS-EXT-AZ:availability_zone          |                             |
    | OS-EXT-SRV-ATTR:host                 | -                           |
    | OS-EXT-SRV-ATTR:hostname             | newInstance                 |
    | OS-EXT-SRV-ATTR:hypervisor_hostname  | -                           |
    | OS-EXT-SRV-ATTR:instance_name        | instance-000029d3           |
    | OS-EXT-SRV-ATTR:kernel_id            |                             |
    | OS-EXT-SRV-ATTR:launch_index         | 0                           |
    | OS-EXT-SRV-ATTR:ramdisk_id           |                             |
    | OS-EXT-SRV-ATTR:reservation_id       | r-91tk2ups                  |
    | OS-EXT-SRV-ATTR:root_device_name     | -                           |
    | OS-EXT-SRV-ATTR:user_data            | -                           |
    | OS-EXT-STS:power_state               | 0                           |
    | OS-EXT-STS:task_state                | scheduling                  |
    | OS-EXT-STS:vm_state                  | building                    |
    | OS-SRV-USG:launched_at               | -                           |
    | OS-SRV-USG:terminated_at             | -                           |
    | accessIPv4                           |                             |
    | accessIPv6                           |                             |
    | config_drive                         |                             |
    | created                              | 2017-01-12T22:10:51Z        |
    | flavor                               | m1.small (2)                |
    | hostId                               |                             |
    | id                                   | <instance_id>               |
    | image                                | ubuntu-16.04.1-server-amd64 |
    | key_name                             | -                           |
    | locked                               | False                       |
    | metadata                             | {}                          |
    | name                                 | newInstance                 |
    | os-extended-volumes:volumes_attached | []                          |
    | progress                             | 0                           |
    | security_groups                      | default                     |
    | status                               | BUILD                       |
    | tenant_id                            | <tenant_id>                 |
    | updated                              | 2017-01-12T22:10:51Z        |
    | user_id                              | <user_id>                   |
    +--------------------------------------+-----------------------------+
    
  2. Verify the instance is available. The new instance reflects a BUILD status until it becomes available. If the status for the new instance changes to ACTIVE, the instance is online.

    $ openstack server list
    +-----------------+----------------+--------+-------------------+-----------------------------------+
    | ID              | Name           | Status | Networks          | Image Name                        |
    +-----------------+----------------+--------+-------------------+-----------------------------------+
    | <instance_id>   | newInstance    | ACTIVE | net=192.168.0.7   | ubuntu-16.04.1-server-amd64       |
    +-----------------+----------------+--------+-------------------+-----------------------------------+
    
  3. After the instance is successfully launched, connect to the instance using a remote console and follow the instructions to install the system.

    Note
    If the instance prompts you again to install the operating system, this indicates your instance is not usable. If you have problems with image creation, see the Virtual Machine Image Guide.

  4. Delete the instance.

    $ openstack server delete <INSTANCE_ID>
    
  5. List the volumes to find the volume that used to be attached to your ISO-created instance. The shutdown=preserve parameter that you set earlier preserved the volume that contained your system installation. Note the ID of the volume.

    $ openstack volume list
    +-------------+--------------+-----------+------+-------------+
    | ID          | Display Name | Status    | Size | Attached to |
    +-------------+--------------+-----------+------+-------------+
    | <volume_id> | 54e3da32...  | available |   10 |             |
    +-------------+--------------+-----------+------+-------------+
    
  6. Upload the volume.

    $ openstack image create ubuntuImage --volume <VOLUME_ID>
    +---------------------+------------------------------+
    | Field               | Value                        |
    +---------------------+------------------------------+
    | container_format    | bare                         |
    | disk_format         | raw                          |
    | display_description | blank-vol                    |
    | id                  | <volume_id>                  |
    | image_id            | <image_id>                   |
    | image_name          | ubuntuImage                  |
    | size                | 10                           |
    | status              | uploading                    |
    | updated_at          | 2017-01-12T23:09:51.000000   |
    | volume_type         | None                         |
    +---------------------+------------------------------+
           
    $ openstack image list
    +-------------+-----------------------------+--------+
    | ID          | Name                        | Status |
    +-------------+-----------------------------+--------+
    | <image_id>  | ubuntuImage                 | saving |
    | <image_id>  | ubuntu-16.04.1-server-amd64 | active |
    +-------------+-----------------------------+--------+
    
  7. The new image reflects a saving status until it becomes available. If the status for the new image changes to active, the instance is successfully uploaded. You can use the new image to boot instances. The instances launched using this image contain the system that you have just installed using the ISO image.