Skip to content

Instantly share code, notes, and snippets.

@yeonki-choi
Last active August 29, 2015 14:05
Show Gist options
  • Save yeonki-choi/99f32ee426ddd05264c5 to your computer and use it in GitHub Desktop.
Save yeonki-choi/99f32ee426ddd05264c5 to your computer and use it in GitHub Desktop.
Nova boot an android-x86 instance.
# Select network
$ nova net-list
+--------------------------------------+---------+------+
| ID | Label | CIDR |
+--------------------------------------+---------+------+
| 0a31d3e5-fdcf-457a-afd1-9664558c80e8 | int-net | - |
| 86fae9cf-134f-4876-b9b0-13280e3ae79e | ext-net | - |
+--------------------------------------+---------+------+
$ net_id=$(nova net-list | grep int-net | awk '{print $2}')
# Check flavor list
$ nova flavor-list
+----------+-----------+-----------+------+-----------+------+-------+-------------+-----------+
| ID | Name | Memory_MB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor | Is_Public |
+----------+-----------+-----------+------+-----------+------+-------+-------------+-----------+
| 1 | m1.tiny | 512 | 1 | 0 | | 1 | 1.0 | True |
| 2 | m1.small | 2048 | 20 | 0 | | 1 | 1.0 | True |
| 3 | m1.medium | 4096 | 40 | 0 | | 2 | 1.0 | True |
| 4 | m1.large | 8192 | 80 | 0 | | 4 | 1.0 | True |
| 5 | m1.xlarge | 16384 | 160 | 0 | | 8 | 1.0 | True |
| 7 | m1.tiny3 | 512 | 8 | 0 | | 1 | 1.0 | True |
+----------+-----------+-----------+------+-----------+------+-------+-------------+-----------+
# Create Openstack image for androidx86 with IDE type.
$ glance image-create --name android_ide --disk-format qcow2 --container-format bare --file ./androidx86-4.4.qcow2 --progress --is-public true --property disk_bus=ide
[=============================>] 100%
+---------------------+--------------------------------------+
| Property | Value |
+---------------------+--------------------------------------+
| Property 'disk_bus' | ide |
| checksum | 9fae0134fb099a74d46f50bf6f8cb051 |
| container_format | bare |
| created_at | 2014-08-10T15:18:20 |
| deleted | False |
| deleted_at | None |
| disk_format | qcow2 |
| id | 4870fd55-cfaa-4693-9500-0903f7bed519 |
| is_public | True |
| min_disk | 0 |
| min_ram | 0 |
| name | android_ide |
| owner | 0eec73ee7cb64ba983cb16dec1deb858 |
| protected | False |
| size | 5680201728 |
| status | active |
| updated_at | 2014-08-10T15:28:01 |
| virtual_size | None |
+---------------------+--------------------------------------+
$ image_id3=$( nova image-list | grep android_ide | awk '{print $2}')
# Create an AndroidX86 instance
$ nova boot --image $image_id3 --flavor m1.tiny3 --security-groups default --key-name default2 --nic net-id=$net_id andro5
+--------------------------------------+----------------------------------------------------+
| Property | Value |
+--------------------------------------+----------------------------------------------------+
| OS-DCF:diskConfig | MANUAL |
| OS-EXT-AZ:availability_zone | nova |
| OS-EXT-SRV-ATTR:host | - |
| OS-EXT-SRV-ATTR:hypervisor_hostname | - |
| OS-EXT-SRV-ATTR:instance_name | instance-00000015 |
| 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 | |
| adminPass | AudXH9uW9m9m |
| config_drive | |
| created | 2014-08-10T15:31:24Z |
| flavor | m1.tiny3 (7) |
| hostId | |
| id | c4a9bc6b-bfa3-474c-bb45-40fbd48a17d8 |
| image | android_ide (4870fd55-cfaa-4693-9500-0903f7bed519) |
| key_name | default2 |
| metadata | {} |
| name | andro5 |
| os-extended-volumes:volumes_attached | [] |
| progress | 0 |
| security_groups | default |
| status | BUILD |
| tenant_id | 0eec73ee7cb64ba983cb16dec1deb858 |
| updated | 2014-08-10T15:31:24Z |
| user_id | c623f1b6c95941028e856c085b3a7cff |
+--------------------------------------+----------------------------------------------------+
$ nova list
+--------------------------------------+--------+--------+------------+-------------+--------------------+
| ID | Name | Status | Task State | Power State | Networks |
+--------------------------------------+--------+--------+------------+-------------+--------------------+
| c4a9bc6b-bfa3-474c-bb45-40fbd48a17d8 | andro5 | ACTIVE | - | Running | int-net=50.50.1.21 |
+--------------------------------------+--------+--------+------------+-------------+--------------------+
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment