Thursday, May 17, 2018

.::: Log Output Create Tenant Project, User, Keypair, Network, Floating, upload Image, Flavors, Instance In Openstack Using CLI :::.

this post as example log output from cli to Create Tenant Project, User, Keypair, Network, Floating, upload Image, Flavors, Instance

1. Create Project & User
# source keystonerc_admin
# openstack project create --description teguht-project-des teguht-project
# openstack user create --project teguht-project --password teguht --email teguh.triharto@microsoft.com teguht
# openstack project list
# openstack project show teguht-project
# openstack user list
# openstack user show teguht
# openstack user role list

Sample Output
[root@openstack ~(keystone_admin)]# openstack project create --description teguht-project-des teguht-project
+-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| description | teguht-project-des               |
| enabled     | True                             |
| id          | 0fc7bb90bc714c8685108415557f08a2 |
| name        | teguht-project                   |
+-------------+----------------------------------+
[root@openstack ~(keystone_admin)]# openstack user create --project teguht-project --password teguht --email teguh.triharto@microsoft.com teguht
+------------+----------------------------------+
| Field      | Value                            |
+------------+----------------------------------+
| email      | teguh.triharto@microsoft.com     |
| enabled    | True                             |
| id         | 8458f9a2a29f4c5d8f4e69fc066bd300 |
| name       | teguht                           |
| project_id | 0fc7bb90bc714c8685108415557f08a2 |
| username   | teguht                           |
+------------+----------------------------------+
[root@openstack ~(keystone_admin)]#
[root@openstack ~(keystone_admin)]# openstack project list
+----------------------------------+--------------------+
| ID                               | Name               |
+----------------------------------+--------------------+
| 0fc7bb90bc714c8685108415557f08a2 | teguht-project     |
| 2d47b0d4fc8143e78185bd9a33957cc1 | admin              |
| 658ffaee6d874a0680f0195093ac6296 | services           |
| 6ad5013192724fd78007140ac2a2579b | amran              |
| 7ba259f26c1a42eebb0295b613d5e804 | aisyah_zahra_amran |
+----------------------------------+--------------------+
[root@openstack ~(keystone_admin)]#

[root@openstack ~(keystone_admin)]# openstack project show teguht-project
+-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| description | teguht-project-des               |
| enabled     | True                             |
| id          | 0fc7bb90bc714c8685108415557f08a2 |
| name        | teguht-project                   |
| properties  |                                  |
+-------------+----------------------------------+
[root@openstack ~(keystone_admin)]#
[root@openstack ~(keystone_admin)]# openstack user list
+----------------------------------+-----------------+
| ID                               | Name            |
+----------------------------------+-----------------+
| 1886ff9891d8427ab570770ec729e450 | heat-cfn        |
| 3994ac2b00b846358293b8adfad838cd | aodh            |
| 454fa25ce801470694d6df44c783fd77 | neutron         |
| 66b3b6c8bbee47cda9570d3cc8d2e200 | amran           |
| 76bdad354e3342fb8dd84e2a6c4cd49d | gnocchi         |
| 77807459de3340e7b1ce2bff59a6fd49 | heat            |
| 7fce5441197142c5ad923a81cfdaa608 | admin           |
| 8458f9a2a29f4c5d8f4e69fc066bd300 | teguht          |
| 9e33dbea0c1945aca15040e2ac206959 | glance          |
| a5c80a6b60064ce7a934d12d54de347a | teguht.triharto |
| c2647dae9a9e49e7a79dcd9ff6d88911 | ceilometer      |
| d1682ecdd3f549b78aea3765e89083d3 | nova            |
| d236785523024be1b482ab56ace72fca | cinder          |
| d8bce13abad84c7583435d58f342fde1 | swift           |
+----------------------------------+-----------------+
[root@openstack ~(keystone_admin)]# openstack user show teguht
+------------+----------------------------------+
| Field      | Value                            |
+------------+----------------------------------+
| email      | teguh.triharto@microsoft.com     |
| enabled    | True                             |
| id         | 8458f9a2a29f4c5d8f4e69fc066bd300 |
| name       | teguht                           |
| project_id | 0fc7bb90bc714c8685108415557f08a2 |
| username   | teguht                           |
+------------+----------------------------------+
[root@openstack ~(keystone_admin)]#
[root@openstack ~(keystone_admin)]# openstack user role list
Listing assignments using user role list is deprecated as of the Newton release. Use role assignment list --user <user-name> --project <project-name> --names instead.
+----------------------------------+------------------+---------+-------+
| ID                               | Name             | Project | User  |
+----------------------------------+------------------+---------+-------+
| 8d6b80ba317741ec993e1ef638584ecb | heat_stack_owner | admin   | admin |
| 9fe2ff9ee4384b1894a90878d3e92bab | _member_         | admin   | admin |
| b074a01883a44d6286feb547599f3d58 | admin            | admin   | admin |
+----------------------------------+------------------+---------+-------+
You have mail in /var/spool/mail/root
[root@openstack ~(keystone_admin)]#

2. Create Keystone for teguht<new_user> & keypair
# cp keystonerc_admin keystonerc_teguht
# cat keystonerc_teguht
unset OS_SERVICE_TOKEN
    export OS_USERNAME=teguht
    export OS_PASSWORD=teguht
    export OS_AUTH_URL=http://172.30.1.111:5000/v2.0
    export PS1='[\u@\h \W(keystone_teguht)]\$ '
  
export OS_TENANT_NAME=teguht-project
export OS_REGION_NAME=RegionOne
#

sample output
[root@openstack ~(keystone_admin)]# cat /root/keystonerc_teguht
unset OS_SERVICE_TOKEN
    export OS_USERNAME=teguht
#    export OS_PASSWORD=1d0c29fb2f9a4a6f
export OS_PASSWORD=teguht
    export OS_AUTH_URL=http://172.30.1.111:5000/v2.0
    export PS1='[\u@\h \W(keystone_teguht)]\$ '
   
export OS_TENANT_NAME=teguht-project
export OS_REGION_NAME=RegionOne
   
You have mail in /var/spool/mail/root
[root@openstack ~(keystone_admin)]#

3. Create keypair
# source keystonerc_teguht
# openstack keypair create teguht-keypair > /root/teguht-keypair.pem
# chmod 600 /root/teguht-keypair.pem
# openstack keypair list
# openstack keypair show teguht-keypair

sample
[root@openstack ~(keystone_teguht)]# openstack keypair create teguht-keypair > /root/teguht-keypair.pem
[root@openstack ~(keystone_teguht)]#
[root@openstack ~(keystone_teguht)]# chmod 600 /root/teguht-keypair.pem
[root@openstack ~(keystone_teguht)]#
[root@openstack ~(keystone_teguht)]# openstack keypair list
+----------------+-------------------------------------------------+
| Name           | Fingerprint                                     |
+----------------+-------------------------------------------------+
| teguht-keypair | 17:64:0f:4d:de:d8:9f:2c:a1:0a:ec:20:94:81:be:5c |
+----------------+-------------------------------------------------+
[root@openstack ~(keystone_teguht)]# openstack keypair show teguht-keypair
+-------------+-------------------------------------------------+
| Field       | Value                                           |
+-------------+-------------------------------------------------+
| created_at  | 2018-05-09T08:37:48.000000                      |
| deleted     | False                                           |
| deleted_at  | None                                            |
| fingerprint | 17:64:0f:4d:de:d8:9f:2c:a1:0a:ec:20:94:81:be:5c |
| id          | 2                                               |
| name        | teguht-keypair                                  |
| updated_at  | None                                            |
| user_id     | 8458f9a2a29f4c5d8f4e69fc066bd300                |
+-------------+-------------------------------------------------+
[root@openstack ~(keystone_teguht)]#

4. Create security
# source keystonerc_teguht
# openstack security group create teguht-security
# openstack security group rule create --protocol tcp --dst-port 22 teguht-security
# openstack security group rule create --protocol icmp teguht-security
# openstack security group list
# openstack security group show teguht-security

sample
[root@openstack ~(keystone_teguht)]# openstack security group create teguht-security
+-----------------+--------------------------------------------------------------------------------------------------+
| Field           | Value                                                                                            |
+-----------------+--------------------------------------------------------------------------------------------------+
| created_at      | 2018-05-09T08:39:02Z                                                                             |
| description     | teguht-security                                                                                  |
| headers         |                                                                                                  |
| id              | bfa10545-e467-4da4-9049-647674464934                                                             |
| name            | teguht-security                                                                                  |
| project_id      | 0fc7bb90bc714c8685108415557f08a2                                                                 |
| project_id      | 0fc7bb90bc714c8685108415557f08a2                                                                 |
| revision_number | 1                                                                                                |
| rules           | created_at='2018-05-09T08:39:02Z', direction='egress', ethertype='IPv4', id='e37eeb5a-053c-476d- |
|                 | affa-167afa608ebc', project_id='0fc7bb90bc714c8685108415557f08a2', revision_number='1',          |
|                 | updated_at='2018-05-09T08:39:02Z'                                                                |
|                 | created_at='2018-05-09T08:39:02Z', direction='egress', ethertype='IPv6', id='55fdf821-3978-425f- |
|                 | 9ace-ae2236e45be0', project_id='0fc7bb90bc714c8685108415557f08a2', revision_number='1',          |
|                 | updated_at='2018-05-09T08:39:02Z'                                                                |
| updated_at      | 2018-05-09T08:39:02Z                                                                             |
+-----------------+--------------------------------------------------------------------------------------------------+
[root@openstack ~(keystone_teguht)]# openstack security group rule create --protocol tcp --dst-port 22 teguht-security
+-------------------+--------------------------------------+
| Field             | Value                                |
+-------------------+--------------------------------------+
| created_at        | 2018-05-09T08:39:04Z                 |
| description       |                                      |
| direction         | ingress                              |
| ethertype         | IPv4                                 |
| headers           |                                      |
| id                | 559d6a48-942f-4d40-8e65-665a7ef14c5c |
| port_range_max    | 22                                   |
| port_range_min    | 22                                   |
| project_id        | 0fc7bb90bc714c8685108415557f08a2     |
| project_id        | 0fc7bb90bc714c8685108415557f08a2     |
| protocol          | tcp                                  |
| remote_group_id   | None                                 |
| remote_ip_prefix  | 0.0.0.0/0                            |
| revision_number   | 1                                    |
| security_group_id | bfa10545-e467-4da4-9049-647674464934 |
| updated_at        | 2018-05-09T08:39:04Z                 |
+-------------------+--------------------------------------+
[root@openstack ~(keystone_teguht)]# openstack security group rule create --protocol icmp teguht-security
+-------------------+--------------------------------------+
| Field             | Value                                |
+-------------------+--------------------------------------+
| created_at        | 2018-05-09T08:39:05Z                 |
| description       |                                      |
| direction         | ingress                              |
| ethertype         | IPv4                                 |
| headers           |                                      |
| id                | e7c63c67-4a37-4ada-8915-73a7d69c7836 |
| port_range_max    | None                                 |
| port_range_min    | None                                 |
| project_id        | 0fc7bb90bc714c8685108415557f08a2     |
| project_id        | 0fc7bb90bc714c8685108415557f08a2     |
| protocol          | icmp                                 |
| remote_group_id   | None                                 |
| remote_ip_prefix  | 0.0.0.0/0                            |
| revision_number   | 1                                    |
| security_group_id | bfa10545-e467-4da4-9049-647674464934 |
| updated_at        | 2018-05-09T08:39:05Z                 |
+-------------------+--------------------------------------+
[root@openstack ~(keystone_teguht)]#
[root@openstack ~(keystone_teguht)]# openstack security group list
+--------------------------------------+-----------------+------------------------+----------------------------------+
| ID                                   | Name            | Description            | Project                          |
+--------------------------------------+-----------------+------------------------+----------------------------------+
| 71814f2e-d10e-4db5-bd65-ba70fe014ee9 | default         | Default security group | 0fc7bb90bc714c8685108415557f08a2 |
| bfa10545-e467-4da4-9049-647674464934 | teguht-security | teguht-security        | 0fc7bb90bc714c8685108415557f08a2 |
+--------------------------------------+-----------------+------------------------+----------------------------------+
[root@openstack ~(keystone_teguht)]# openstack security group show teguht-security
+-----------------+--------------------------------------------------------------------------------------------------+
| Field           | Value                                                                                            |
+-----------------+--------------------------------------------------------------------------------------------------+
| created_at      | 2018-05-09T08:39:02Z                                                                             |
| description     | teguht-security                                                                                  |
| id              | bfa10545-e467-4da4-9049-647674464934                                                             |
| name            | teguht-security                                                                                  |
| project_id      | 0fc7bb90bc714c8685108415557f08a2                                                                 |
| project_id      | 0fc7bb90bc714c8685108415557f08a2                                                                 |
| revision_number | 3                                                                                                |
| rules           | created_at='2018-05-09T08:39:04Z', direction='ingress', ethertype='IPv4', id='559d6a48-942f-     |
|                 | 4d40-8e65-665a7ef14c5c', port_range_max='22', port_range_min='22',                               |
|                 | project_id='0fc7bb90bc714c8685108415557f08a2', protocol='tcp', remote_ip_prefix='0.0.0.0/0',     |
|                 | revision_number='1', updated_at='2018-05-09T08:39:04Z'                                           |
|                 | created_at='2018-05-09T08:39:02Z', direction='egress', ethertype='IPv6', id='55fdf821-3978-425f- |
|                 | 9ace-ae2236e45be0', project_id='0fc7bb90bc714c8685108415557f08a2', revision_number='1',          |
|                 | updated_at='2018-05-09T08:39:02Z'                                                                |
|                 | created_at='2018-05-09T08:39:02Z', direction='egress', ethertype='IPv4', id='e37eeb5a-053c-476d- |
|                 | affa-167afa608ebc', project_id='0fc7bb90bc714c8685108415557f08a2', revision_number='1',          |
|                 | updated_at='2018-05-09T08:39:02Z'                                                                |
|                 | created_at='2018-05-09T08:39:05Z', direction='ingress', ethertype='IPv4',                        |
|                 | id='e7c63c67-4a37-4ada-8915-73a7d69c7836', project_id='0fc7bb90bc714c8685108415557f08a2',        |
|                 | protocol='icmp', remote_ip_prefix='0.0.0.0/0', revision_number='1',                              |
|                 | updated_at='2018-05-09T08:39:05Z'                                                                |
| updated_at      | 2018-05-09T08:39:05Z                                                                             |
+-----------------+--------------------------------------------------------------------------------------------------+
[root@openstack ~(keystone_teguht)]#

5. Create Private Network
# source /root/keystonerc_teguht
# openstack network create priv_net
# openstack subnet create --dhcp --subnet-range 2.2.2.0/24 --gateway 2.2.2.1 --allocation-pool start=2.2.2.10,end=2.2.2.30 --dns-nameserver 8.8.8.8 --network priv_net priv_subnet

# source /root/keystonerc_admin
# openstack network  show priv_net
# openstack network  set --share priv_net
# openstack network  show priv_net

# source /root/keystonerc_teguht
# openstack network list
# openstack network show priv_net
# openstack subnet list
# openstack subnet show priv_subnet

sample output
[root@openstack ~(keystone_teguht)]# openstack network create priv_net
+-------------------------+--------------------------------------+
| Field                   | Value                                |
+-------------------------+--------------------------------------+
| admin_state_up          | UP                                   |
| availability_zone_hints |                                      |
| availability_zones      |                                      |
| created_at              | 2018-05-09T08:58:09Z                 |
| description             |                                      |
| headers                 |                                      |
| id                      | 5ec5af36-15db-42d1-b016-cb18c655ad8f |
| ipv4_address_scope      | None                                 |
| ipv6_address_scope      | None                                 |
| mtu                     | 1450                                 |
| name                    | priv_net                             |
| project_id              | 0fc7bb90bc714c8685108415557f08a2     |
| project_id              | 0fc7bb90bc714c8685108415557f08a2     |
| revision_number         | 2                                    |
| router:external         | Internal                             |
| shared                  | False                                |
| status                  | ACTIVE                               |
| subnets                 |                                      |
| tags                    | []                                   |
| updated_at              | 2018-05-09T08:58:09Z                 |
+-------------------------+--------------------------------------+
[root@openstack ~(keystone_teguht)]#
[root@openstack ~(keystone_teguht)]# openstack subnet create --dhcp --subnet-range 2.2.2.0/24 --gateway 2.2.2.1 --allocation-pool start=2.2.2.10,end=2.2.2.30 --dns-nameserver 8.8.8.8 --network priv_net priv_subnet
+-------------------+--------------------------------------+
| Field             | Value                                |
+-------------------+--------------------------------------+
| allocation_pools  | 2.2.2.10-2.2.2.30                    |
| cidr              | 2.2.2.0/24                           |
| created_at        | 2018-05-09T08:58:13Z                 |
| description       |                                      |
| dns_nameservers   | 8.8.8.8                              |
| enable_dhcp       | True                                 |
| gateway_ip        | 2.2.2.1                              |
| headers           |                                      |
| host_routes       |                                      |
| id                | bc9b485d-297d-4f1c-bc2b-9bf984581358 |
| ip_version        | 4                                    |
| ipv6_address_mode | None                                 |
| ipv6_ra_mode      | None                                 |
| name              | priv_subnet                          |
| network_id        | 5ec5af36-15db-42d1-b016-cb18c655ad8f |
| project_id        | 0fc7bb90bc714c8685108415557f08a2     |
| project_id        | 0fc7bb90bc714c8685108415557f08a2     |
| revision_number   | 2                                    |
| service_types     | []                                   |
| subnetpool_id     | None                                 |
| updated_at        | 2018-05-09T08:58:13Z                 |
+-------------------+--------------------------------------+
[root@openstack ~(keystone_teguht)]#
[root@openstack ~(keystone_admin)]# openstack network  show priv_net
+---------------------------+--------------------------------------+
| Field                     | Value                                |
+---------------------------+--------------------------------------+
| admin_state_up            | UP                                   |
| availability_zone_hints   |                                      |
| availability_zones        | nova                                 |
| created_at                | 2018-05-09T09:07:53Z                 |
| description               |                                      |
| id                        | 6ad3e3bf-9b80-426e-8db6-251944763e62 |
| ipv4_address_scope        | None                                 |
| ipv6_address_scope        | None                                 |
| mtu                       | 1450                                 |
| name                      | priv_net                             |
| project_id                | 0fc7bb90bc714c8685108415557f08a2     |
| project_id                | 0fc7bb90bc714c8685108415557f08a2     |
| provider:network_type     | vxlan                                |
| provider:physical_network | None                                 |
| provider:segmentation_id  | 99                                   |
| revision_number           | 5                                    |
| router:external           | Internal                             |
| shared                    | False                                |
| status                    | ACTIVE                               |
| subnets                   | 547b6765-4091-465e-83d0-7ac092085dfe |
| tags                      | []                                   |
| updated_at                | 2018-05-09T09:27:33Z                 |
+---------------------------+--------------------------------------+
[root@openstack ~(keystone_admin)]# openstack network  set --share priv_net
[root@openstack ~(keystone_admin)]# openstack network  show priv_net
+---------------------------+--------------------------------------+
| Field                     | Value                                |
+---------------------------+--------------------------------------+
| admin_state_up            | UP                                   |
| availability_zone_hints   |                                      |
| availability_zones        | nova                                 |
| created_at                | 2018-05-09T09:07:53Z                 |
| description               |                                      |
| id                        | 6ad3e3bf-9b80-426e-8db6-251944763e62 |
| ipv4_address_scope        | None                                 |
| ipv6_address_scope        | None                                 |
| mtu                       | 1450                                 |
| name                      | priv_net                             |
| project_id                | 0fc7bb90bc714c8685108415557f08a2     |
| project_id                | 0fc7bb90bc714c8685108415557f08a2     |
| provider:network_type     | vxlan                                |
| provider:physical_network | None                                 |
| provider:segmentation_id  | 99                                   |
| revision_number           | 6                                    |
| router:external           | Internal                             |
| shared                    | True                                 |
| status                    | ACTIVE                               |
| subnets                   | 547b6765-4091-465e-83d0-7ac092085dfe |
| tags                      | []                                   |
| updated_at                | 2018-05-09T09:28:59Z                 |
+---------------------------+--------------------------------------+
[root@openstack ~(keystone_admin)]#
[root@openstack ~(keystone_teguht)]# openstack network list
+--------------------------------------+----------+--------------------------------------+
| ID                                   | Name     | Subnets                              |
+--------------------------------------+----------+--------------------------------------+
| ce2df5d5-bde9-4ac3-9dc0-a575f71de7c3 | pub_net  | 310079a9-5978-4607-aede-8484a5031e98 |
| ea7d0d1e-11ef-4116-a8f5-29f51e4e5d9c | priv_net | e4bf0054-c34e-453e-b027-0cdcd20aad9a |
+--------------------------------------+----------+--------------------------------------+
[root@openstack ~(keystone_teguht)]# openstack network show priv_net
+-------------------------+--------------------------------------+
| Field                   | Value                                |
+-------------------------+--------------------------------------+
| admin_state_up          | UP                                   |
| availability_zone_hints |                                      |
| availability_zones      | nova                                 |
| created_at              | 2018-05-11T09:48:20Z                 |
| description             |                                      |
| id                      | ea7d0d1e-11ef-4116-a8f5-29f51e4e5d9c |
| ipv4_address_scope      | None                                 |
| ipv6_address_scope      | None                                 |
| mtu                     | 1450                                 |
| name                    | priv_net                             |
| project_id              | 0fc7bb90bc714c8685108415557f08a2     |
| project_id              | 0fc7bb90bc714c8685108415557f08a2     |
| revision_number         | 5                                    |
| router:external         | Internal                             |
| shared                  | True                                 |
| status                  | ACTIVE                               |
| subnets                 | e4bf0054-c34e-453e-b027-0cdcd20aad9a |
| tags                    | []                                   |
| updated_at              | 2018-05-11T09:48:26Z                 |
+-------------------------+--------------------------------------+
You have mail in /var/spool/mail/root
[root@openstack ~(keystone_teguht)]#
[root@openstack ~(keystone_teguht)]# openstack subnet list
+--------------------------------------+-------------+--------------------------------------+----------------+
| ID                                   | Name        | Network                              | Subnet         |
+--------------------------------------+-------------+--------------------------------------+----------------+
| 310079a9-5978-4607-aede-8484a5031e98 | pub_subnet  | ce2df5d5-bde9-4ac3-9dc0-a575f71de7c3 | 172.30.1.0/24 |
| e4bf0054-c34e-453e-b027-0cdcd20aad9a | priv_subnet | ea7d0d1e-11ef-4116-a8f5-29f51e4e5d9c | 2.2.2.0/24     |
+--------------------------------------+-------------+--------------------------------------+----------------+
[root@openstack ~(keystone_teguht)]# openstack subnet show priv_subnet
+-------------------+--------------------------------------+
| Field             | Value                                |
+-------------------+--------------------------------------+
| allocation_pools  | 2.2.2.10-2.2.2.30                    |
| cidr              | 2.2.2.0/24                           |
| created_at        | 2018-05-11T09:48:22Z                 |
| description       |                                      |
| dns_nameservers   | 8.8.8.8                              |
| enable_dhcp       | True                                 |
| gateway_ip        | 2.2.2.1                              |
| host_routes       |                                      |
| id                | e4bf0054-c34e-453e-b027-0cdcd20aad9a |
| ip_version        | 4                                    |
| ipv6_address_mode | None                                 |
| ipv6_ra_mode      | None                                 |
| name              | priv_subnet                          |
| network_id        | ea7d0d1e-11ef-4116-a8f5-29f51e4e5d9c |
| project_id        | 0fc7bb90bc714c8685108415557f08a2     |
| project_id        | 0fc7bb90bc714c8685108415557f08a2     |
| revision_number   | 2                                    |
| service_types     | []                                   |
| subnetpool_id     | None                                 |
| updated_at        | 2018-05-11T09:48:22Z                 |
+-------------------+--------------------------------------+
[root@openstack ~(keystone_teguht)]#

6. Create Public Network
# source /root/keystonerc_teguht
# openstack network create pub_net
# openstack subnet create --no-dhcp --subnet-range 172.30.1.0/24 --allocation-pool start=172.30.1.10,end=172.30.1.30 --dns-nameserver 172.30.2.22 --network pub_net pub_subnet

# source /root/keystonerc_admin
# openstack network show pub_net
# openstack network set --share --external pub_net
# openstack network show pub_net

# source /root/keystonerc_teguht
# openstack network show pub_net
# openstack subnet list
# openstack subnet show pub_subnet

sample
[root@openstack ~(keystone_teguht)]# openstack network create pub_net
+-------------------------+--------------------------------------+
| Field                   | Value                                |
+-------------------------+--------------------------------------+
| admin_state_up          | UP                                   |
| availability_zone_hints |                                      |
| availability_zones      |                                      |
| created_at              | 2018-05-09T09:30:29Z                 |
| description             |                                      |
| headers                 |                                      |
| id                      | cf15f57b-d82b-458d-be26-f454f7054366 |
| ipv4_address_scope      | None                                 |
| ipv6_address_scope      | None                                 |
| mtu                     | 1450                                 |
| name                    | pub_net                              |
| project_id              | 0fc7bb90bc714c8685108415557f08a2     |
| project_id              | 0fc7bb90bc714c8685108415557f08a2     |
| revision_number         | 2                                    |
| router:external         | Internal                             |
| shared                  | False                                |
| status                  | ACTIVE                               |
| subnets                 |                                      |
| tags                    | []                                   |
| updated_at              | 2018-05-09T09:30:29Z                 |
+-------------------------+--------------------------------------+
[root@openstack ~(keystone_teguht)]#
[root@openstack ~(keystone_teguht)]# openstack subnet create --no-dhcp --subnet-range 172.30.1.0/24 --allocation-pool start=172.30.1.10,end=172.30.1.30 --dns-nameserver 172.30.2.54 --network pub_net pub_subnet
+-------------------+--------------------------------------+
| Field             | Value                                |
+-------------------+--------------------------------------+
| allocation_pools  | 172.30.1.10-172.30.1.30            |
| cidr              | 172.30.1.0/24                       |
| created_at        | 2018-05-09T09:30:31Z                 |
| description       |                                      |
| dns_nameservers   | 172.30.2.54                        |
| enable_dhcp       | False                                |
| gateway_ip        | 172.30.1.1                          |
| headers           |                                      |
| host_routes       |                                      |
| id                | df6e1586-0a65-4a62-a80f-84fada709ab5 |
| ip_version        | 4                                    |
| ipv6_address_mode | None                                 |
| ipv6_ra_mode      | None                                 |
| name              | pub_subnet                           |
| network_id        | cf15f57b-d82b-458d-be26-f454f7054366 |
| project_id        | 0fc7bb90bc714c8685108415557f08a2     |
| project_id        | 0fc7bb90bc714c8685108415557f08a2     |
| revision_number   | 2                                    |
| service_types     | []                                   |
| subnetpool_id     | None                                 |
| updated_at        | 2018-05-09T09:30:31Z                 |
+-------------------+--------------------------------------+
[root@openstack ~(keystone_teguht)]#

[root@openstack ~(keystone_admin)]# openstack network show pub_net
+---------------------------+--------------------------------------+
| Field                     | Value                                |
+---------------------------+--------------------------------------+
| admin_state_up            | UP                                   |
| availability_zone_hints   |                                      |
| availability_zones        | nova                                 |
| created_at                | 2018-05-09T09:30:29Z                 |
| description               |                                      |
| id                        | cf15f57b-d82b-458d-be26-f454f7054366 |
| ipv4_address_scope        | None                                 |
| ipv6_address_scope        | None                                 |
| mtu                       | 1450                                 |
| name                      | pub_net                              |
| project_id                | 0fc7bb90bc714c8685108415557f08a2     |
| project_id                | 0fc7bb90bc714c8685108415557f08a2     |
| provider:network_type     | vxlan                                |
| provider:physical_network | None                                 |
| provider:segmentation_id  | 97                                   |
| revision_number           | 4                                    |
| router:external           | Internal                             |
| shared                    | False                                |
| status                    | ACTIVE                               |
| subnets                   | df6e1586-0a65-4a62-a80f-84fada709ab5 |
| tags                      | []                                   |
| updated_at                | 2018-05-09T09:30:31Z                 |
+---------------------------+--------------------------------------+
[root@openstack ~(keystone_admin)]# openstack network set --share --external pub_net
[root@openstack ~(keystone_admin)]# openstack network show pub_net
+---------------------------+--------------------------------------+
| Field                     | Value                                |
+---------------------------+--------------------------------------+
| admin_state_up            | UP                                   |
| availability_zone_hints   |                                      |
| availability_zones        | nova                                 |
| created_at                | 2018-05-09T09:30:29Z                 |
| description               |                                      |
| id                        | cf15f57b-d82b-458d-be26-f454f7054366 |
| ipv4_address_scope        | None                                 |
| ipv6_address_scope        | None                                 |
| is_default                | False                                |
| mtu                       | 1450                                 |
| name                      | pub_net                              |
| project_id                | 0fc7bb90bc714c8685108415557f08a2     |
| project_id                | 0fc7bb90bc714c8685108415557f08a2     |
| provider:network_type     | vxlan                                |
| provider:physical_network | None                                 |
| provider:segmentation_id  | 97                                   |
| revision_number           | 6                                    |
| router:external           | External                             |
| shared                    | True                                 |
| status                    | ACTIVE                               |
| subnets                   | df6e1586-0a65-4a62-a80f-84fada709ab5 |
| tags                      | []                                   |
| updated_at                | 2018-05-09T10:12:34Z                 |
+---------------------------+--------------------------------------+
[root@openstack ~(keystone_admin)]#

[root@openstack ~(keystone_teguht)]# openstack network list
+--------------------------------------+----------+--------------------------------------+
| ID                                   | Name     | Subnets                              |
+--------------------------------------+----------+--------------------------------------+
| ce2df5d5-bde9-4ac3-9dc0-a575f71de7c3 | pub_net  | 310079a9-5978-4607-aede-8484a5031e98 |
| ea7d0d1e-11ef-4116-a8f5-29f51e4e5d9c | priv_net | e4bf0054-c34e-453e-b027-0cdcd20aad9a |
+--------------------------------------+----------+--------------------------------------+
[root@openstack ~(keystone_teguht)]# openstack network show pub_net
+-------------------------+--------------------------------------+
| Field                   | Value                                |
+-------------------------+--------------------------------------+
| admin_state_up          | UP                                   |
| availability_zone_hints |                                      |
| availability_zones      | nova                                 |
| created_at              | 2018-05-11T09:48:30Z                 |
| description             |                                      |
| id                      | ce2df5d5-bde9-4ac3-9dc0-a575f71de7c3 |
| ipv4_address_scope      | None                                 |
| ipv6_address_scope      | None                                 |
| is_default              | False                                |
| mtu                     | 1450                                 |
| name                    | pub_net                              |
| project_id              | 0fc7bb90bc714c8685108415557f08a2     |
| project_id              | 0fc7bb90bc714c8685108415557f08a2     |
| revision_number         | 6                                    |
| router:external         | External                             |
| shared                  | True                                 |
| status                  | ACTIVE                               |
| subnets                 | 310079a9-5978-4607-aede-8484a5031e98 |
| tags                    | []                                   |
| updated_at              | 2018-05-11T09:48:37Z                 |
+-------------------------+--------------------------------------+
[root@openstack ~(keystone_teguht)]# openstack subnet list
+--------------------------------------+-------------+--------------------------------------+----------------+
| ID                                   | Name        | Network                              | Subnet         |
+--------------------------------------+-------------+--------------------------------------+----------------+
| 310079a9-5978-4607-aede-8484a5031e98 | pub_subnet  | ce2df5d5-bde9-4ac3-9dc0-a575f71de7c3 | 172.30.1.0/24 |
| e4bf0054-c34e-453e-b027-0cdcd20aad9a | priv_subnet | ea7d0d1e-11ef-4116-a8f5-29f51e4e5d9c | 2.2.2.0/24     |
+--------------------------------------+-------------+--------------------------------------+----------------+
[root@openstack ~(keystone_teguht)]# openstack subnet show pub_subnet
+-------------------+--------------------------------------+
| Field             | Value                                |
+-------------------+--------------------------------------+
| allocation_pools  | 172.30.1.10-172.30.1.30            |
| cidr              | 172.30.1.0/24                       |
| created_at        | 2018-05-11T09:48:33Z                 |
| description       |                                      |
| dns_nameservers   | 172.30.2.54                        |
| enable_dhcp       | False                                |
| gateway_ip        | 172.30.1.1                          |
| host_routes       |                                      |
| id                | 310079a9-5978-4607-aede-8484a5031e98 |
| ip_version        | 4                                    |
| ipv6_address_mode | None                                 |
| ipv6_ra_mode      | None                                 |
| name              | pub_subnet                           |
| network_id        | ce2df5d5-bde9-4ac3-9dc0-a575f71de7c3 |
| project_id        | 0fc7bb90bc714c8685108415557f08a2     |
| project_id        | 0fc7bb90bc714c8685108415557f08a2     |
| revision_number   | 2                                    |
| service_types     | []                                   |
| subnetpool_id     | None                                 |
| updated_at        | 2018-05-11T09:48:33Z                 |
+-------------------+--------------------------------------+
[root@openstack ~(keystone_teguht)]#


https://www.tuxfixer.com/openstack-how-to-manually-delete-orphaned-neutron-port/#more-1206

use neutron
delete from ports where id='a476470a-6d36-4dfc-bb57-6f53438f0aa5';
http://docs.metacloud.com/latest/user-guide/cli-deleting-network-resources/

7. Create Router

# source /root/keystonerc_teguht
# openstack router create router-teguht
# neutron router-gateway-set router-teguht pub_net
# openstack router add subnet router-teguht priv_subnet
# openstack router list
# openstack router show router-teguht
# neutron port-list

sample
[root@openstack ~(keystone_teguht)]# openstack router create router-teguht
+-------------------------+--------------------------------------+
| Field                   | Value                                |
+-------------------------+--------------------------------------+
| admin_state_up          | UP                                   |
| availability_zone_hints |                                      |
| availability_zones      |                                      |
| created_at              | 2018-05-09T10:24:25Z                 |
| description             |                                      |
| external_gateway_info   | null                                 |
| flavor_id               | None                                 |
| headers                 |                                      |
| id                      | d7af2b1b-eb83-4685-8ecd-0238a395be3f |
| name                    | router-teguht                        |
| project_id              | 0fc7bb90bc714c8685108415557f08a2     |
| project_id              | 0fc7bb90bc714c8685108415557f08a2     |
| revision_number         | 3                                    |
| routes                  |                                      |
| status                  | ACTIVE                               |
| updated_at              | 2018-05-09T10:24:25Z                 |
+-------------------------+--------------------------------------+
[root@openstack ~(keystone_teguht)]# neutron router-gateway-set router-teguht pub_net
Set gateway for router router-teguht
[root@openstack ~(keystone_teguht)]# openstack router add subnet router-teguht priv_subnet
HttpException: Bad Request
[root@openstack ~(keystone_teguht)]#
[root@openstack ~(keystone_teguht)]# openstack router list
+-------------------------------+---------------+--------+-------+-------------+----+--------------------------------+
| ID                            | Name          | Status | State | Distributed | HA | Project                        |
+-------------------------------+---------------+--------+-------+-------------+----+--------------------------------+
| fd4d9360-b1c0-46ce-b379-f0be7 | router-teguht | ACTIVE | UP    |             |    | 0fc7bb90bc714c8685108415557f08 |
| fe35aa3                       |               |        |       |             |    | a2                             |
+-------------------------------+---------------+--------+-------+-------------+----+--------------------------------+
[root@openstack ~(keystone_teguht)]# openstack router show router-teguht
+-------------------------+------------------------------------------------------------------------------------------+
| Field                   | Value                                                                                    |
+-------------------------+------------------------------------------------------------------------------------------+
| admin_state_up          | UP                                                                                       |
| availability_zone_hints |                                                                                          |
| availability_zones      | nova                                                                                     |
| created_at              | 2018-05-11T09:48:41Z                                                                     |
| description             |                                                                                          |
| external_gateway_info   | {"network_id": "ce2df5d5-bde9-4ac3-9dc0-a575f71de7c3", "enable_snat": true,              |
|                         | "external_fixed_ips": [{"subnet_id": "310079a9-5978-4607-aede-8484a5031e98",             |
|                         | "ip_address": "172.30.1.12"}]}                                                          |
| flavor_id               | None                                                                                     |
| id                      | fd4d9360-b1c0-46ce-b379-f0be7fe35aa3                                                     |
| name                    | router-teguht                                                                            |
| project_id              | 0fc7bb90bc714c8685108415557f08a2                                                         |
| project_id              | 0fc7bb90bc714c8685108415557f08a2                                                         |
| revision_number         | 7                                                                                        |
| routes                  |                                                                                          |
| status                  | ACTIVE                                                                                   |
| updated_at              | 2018-05-11T09:48:49Z                                                                     |
+-------------------------+------------------------------------------------------------------------------------------+
[root@openstack ~(keystone_teguht)]#
[root@openstack ~(keystone_teguht)]# neutron port-list
+--------------------------------------+------+-------------------+--------------------------------------------+
| id                                   | name | mac_address       | fixed_ips                                  |
+--------------------------------------+------+-------------------+--------------------------------------------+
| 59587023-06b7-440f-b53e-8b1b1dcb00e1 |      | fa:16:3e:df:c0:d4 | {"subnet_id": "310079a9-5978-4607-aede-    |
|                                      |      |                   | 8484a5031e98", "ip_address":               |
|                                      |      |                   | "172.30.1.11"}                            |
| 633378a2-0a31-4837-bf00-fa0bd510087e |      | fa:16:3e:5f:23:a3 | {"subnet_id": "310079a9-5978-4607-aede-    |
|                                      |      |                   | 8484a5031e98", "ip_address":               |
|                                      |      |                   | "172.30.1.12"}                            |
| 7246722d-5222-4fa1-b270-2de635a979fa |      | fa:16:3e:c8:e9:27 | {"subnet_id": "e4bf0054-c34e-              |
|                                      |      |                   | 453e-b027-0cdcd20aad9a", "ip_address":     |
|                                      |      |                   | "2.2.2.11"}                                |
| 756bfdd5-449f-42c2-9329-df3874bf1671 |      | fa:16:3e:5a:73:d5 | {"subnet_id": "e4bf0054-c34e-              |
|                                      |      |                   | 453e-b027-0cdcd20aad9a", "ip_address":     |
|                                      |      |                   | "2.2.2.1"}                                 |
| a0d74203-5f50-41de-9bcf-018b29896951 |      | fa:16:3e:2a:bc:e8 | {"subnet_id": "310079a9-5978-4607-aede-    |
|                                      |      |                   | 8484a5031e98", "ip_address":               |
|                                      |      |                   | "172.30.1.13"}                            |
| c91c8b9e-813f-4c08-99c3-e5b94c58901f |      | fa:16:3e:48:57:8b | {"subnet_id": "e4bf0054-c34e-              |
|                                      |      |                   | 453e-b027-0cdcd20aad9a", "ip_address":     |
|                                      |      |                   | "2.2.2.10"}                                |
| d9efb3df-5b38-4d8a-a463-cb9b38166d73 |      | fa:16:3e:15:68:c3 | {"subnet_id": "310079a9-5978-4607-aede-    |
|                                      |      |                   | 8484a5031e98", "ip_address":               |
|                                      |      |                   | "172.30.1.15"}                            |
| f5f345fc-13f6-40df-9499-7a5a0f6d27ed |      | fa:16:3e:1b:f3:30 | {"subnet_id": "e4bf0054-c34e-              |
|                                      |      |                   | 453e-b027-0cdcd20aad9a", "ip_address":     |
|                                      |      |                   | "2.2.2.14"}                                |
+--------------------------------------+------+-------------------+--------------------------------------------+
[root@openstack ~(keystone_teguht)]#

8. Create Floating IP
# source /root/keystonerc_teguht
# openstack floating ip create pub_net
# openstack floating ip create pub_net
# openstack floating ip list
# openstack floating ip show 172.30.1.11
# openstack floating ip show 172.30.1.15

sample
[root@openstack data(keystone_teguht)]# openstack floating ip create pub_net
+---------------------+--------------------------------------+
| Field               | Value                                |
+---------------------+--------------------------------------+
| created_at          | 2018-05-14T10:34:21Z                 |
| description         |                                      |
| fixed_ip_address    | None                                 |
| floating_ip_address | 172.30.1.11                         |
| floating_network_id | ce2df5d5-bde9-4ac3-9dc0-a575f71de7c3 |
| headers             |                                      |
| id                  | 8c73913a-4f5b-43c4-8eff-068021cc07f9 |
| port_id             | None                                 |
| project_id          | 0fc7bb90bc714c8685108415557f08a2     |
| project_id          | 0fc7bb90bc714c8685108415557f08a2     |
| revision_number     | 1                                    |
| router_id           | None                                 |
| status              | DOWN                                 |
| updated_at          | 2018-05-14T10:34:21Z                 |
+---------------------+--------------------------------------+
[root@openstack data(keystone_teguht)]#
[root@openstack data(keystone_teguht)]# openstack floating ip create pub_net
+---------------------+--------------------------------------+
| Field               | Value                                |
+---------------------+--------------------------------------+
| created_at          | 2018-05-14T10:34:21Z                 |
| description         |                                      |
| fixed_ip_address    | None                                 |
| floating_ip_address | 172.30.1.15                         |
| floating_network_id | ce2df5d5-bde9-4ac3-9dc0-a575f71de7c3 |
| headers             |                                      |
| id                  | dfbfe3e1-ec26-4607-b3b8-44c4f66d9c98 |
| port_id             | None                                 |
| project_id          | 0fc7bb90bc714c8685108415557f08a2     |
| project_id          | 0fc7bb90bc714c8685108415557f08a2     |
| revision_number     | 1                                    |
| router_id           | None                                 |
| status              | DOWN                                 |
| updated_at          | 2018-05-14T10:34:21Z                 |
+---------------------+--------------------------------------+
[root@openstack data(keystone_teguht)]#
[root@openstack ~(keystone_teguht)]# openstack floating ip list
+-------------------------------------+---------------------+------------------+-------------------------------------+
| ID                                  | Floating IP Address | Fixed IP Address | Port                                |
+-------------------------------------+---------------------+------------------+-------------------------------------+
| 8c73913a-4f5b-43c4-8eff-            | 172.30.1.11        | 2.2.2.11         | 7246722d-5222-4fa1-b270-2de635a979f |
| 068021cc07f9                        |                     |                  | a                                   |
| 9e54db9f-9b4d-                      | 172.30.1.13        | None             | None                                |
| 4c05-82b4-2e56d2f724e7              |                     |                  |                                     |
| dfbfe3e1-ec26-4607-b3b8-44c4f66d9c9 | 172.30.1.15        | 2.2.2.14         | f5f345fc-                           |
| 8                                   |                     |                  | 13f6-40df-9499-7a5a0f6d27ed         |
+-------------------------------------+---------------------+------------------+-------------------------------------+
You have mail in /var/spool/mail/root

[root@openstack ~(keystone_teguht)]# openstack floating ip show 172.30.1.15
+---------------------+--------------------------------------+
| Field               | Value                                |
+---------------------+--------------------------------------+
| created_at          | 2018-05-14T10:34:21Z                 |
| description         |                                      |
| fixed_ip_address    | 2.2.2.14                             |
| floating_ip_address | 172.30.1.15                         |
| floating_network_id | ce2df5d5-bde9-4ac3-9dc0-a575f71de7c3 |
| id                  | dfbfe3e1-ec26-4607-b3b8-44c4f66d9c98 |
| port_id             | f5f345fc-13f6-40df-9499-7a5a0f6d27ed |
| project_id          | 0fc7bb90bc714c8685108415557f08a2     |
| project_id          | 0fc7bb90bc714c8685108415557f08a2     |
| revision_number     | 6                                    |
| router_id           | fd4d9360-b1c0-46ce-b379-f0be7fe35aa3 |
| status              | ACTIVE                               |
| updated_at          | 2018-05-15T20:01:14Z                 |
+---------------------+--------------------------------------+
[root@openstack ~(keystone_teguht)]# openstack floating ip show 172.30.1.11
+---------------------+--------------------------------------+
| Field               | Value                                |
+---------------------+--------------------------------------+
| created_at          | 2018-05-11T09:50:33Z                 |
| description         |                                      |
| fixed_ip_address    | 2.2.2.11                             |
| floating_ip_address | 172.30.1.11                         |
| floating_network_id | ce2df5d5-bde9-4ac3-9dc0-a575f71de7c3 |
| id                  | 8c73913a-4f5b-43c4-8eff-068021cc07f9 |
| port_id             | 7246722d-5222-4fa1-b270-2de635a979fa |
| project_id          | 0fc7bb90bc714c8685108415557f08a2     |
| project_id          | 0fc7bb90bc714c8685108415557f08a2     |
| revision_number     | 10                                   |
| router_id           | fd4d9360-b1c0-46ce-b379-f0be7fe35aa3 |
| status              | ACTIVE                               |
| updated_at          | 2018-05-15T20:01:19Z                 |
+---------------------+--------------------------------------+
[root@openstack ~(keystone_teguht)]#

9. Uploading Image
# source /root/keystonerc_admin
# openstack image create --disk-format qcow2 --file cirros-0.4.0-x86_64-disk.img --public cirros-Image
or
# openstack image create --disk-format qcow2 --file /data/cirros-0.4.0-x86_64-disk.img --public cirros-Image
# openstack image list
# openstack image show cirros-Image

sample
[root@openstack data(keystone_admin)]# openstack image create --disk-format qcow2 --file cirros-0.4.0-x86_64-disk.img --public cirros-Image
+------------------+------------------------------------------------------+
| Field            | Value                                                |
+------------------+------------------------------------------------------+
| checksum         | 443b7623e27ecf03dc9e01ee93f67afe                     |
| container_format | bare                                                 |
| created_at       | 2018-05-14T10:29:28Z                                 |
| disk_format      | iso                                                  |
| file             | /v2/images/c92c2545-d1e1-4c91-bfb6-6d06b895063a/file |
| id               | c92c2545-d1e1-4c91-bfb6-6d06b895063a                 |
| min_disk         | 0                                                    |
| min_ram          | 0                                                    |
| name             | cirros-Image                                         |
| owner            | 2d47b0d4fc8143e78185bd9a33957cc1                     |
| protected        | False                                                |
| schema           | /v2/schemas/image                                    |
| size             | 12716032                                             |
| status           | active                                               |
| tags             |                                                      |
| updated_at       | 2018-05-14T10:29:29Z                                 |
| virtual_size     | None                                                 |
| visibility       | public                                               |
+------------------+------------------------------------------------------+
You have mail in /var/spool/mail/root
[root@openstack data(keystone_admin)]#
[root@openstack ~(keystone_admin)]# openstack image create --disk-format qcow2 --file /data/cirros-0.4.0-x86_64-disk.img --public cirros-Image-test
+------------------+------------------------------------------------------+
| Field            | Value                                                |
+------------------+------------------------------------------------------+
| checksum         | 443b7623e27ecf03dc9e01ee93f67afe                     |
| container_format | bare                                                 |
| created_at       | 2018-05-17T03:20:46Z                                 |
| disk_format      | qcow2                                                |
| file             | /v2/images/3217b568-9740-4520-b807-42f44091f06d/file |
| id               | 3217b568-9740-4520-b807-42f44091f06d                 |
| min_disk         | 0                                                    |
| min_ram          | 0                                                    |
| name             | cirros-Image-test                                    |
| owner            | 2d47b0d4fc8143e78185bd9a33957cc1                     |
| protected        | False                                                |
| schema           | /v2/schemas/image                                    |
| size             | 12716032                                             |
| status           | active                                               |
| tags             |                                                      |
| updated_at       | 2018-05-17T03:20:46Z                                 |
| virtual_size     | None                                                 |
| visibility       | public                                               |
+------------------+------------------------------------------------------+
[root@openstack ~(keystone_admin)]#
[root@openstack ~(keystone_admin)]# openstack image list
+--------------------------------------+-------------------+--------+
| ID                                   | Name              | Status |
+--------------------------------------+-------------------+--------+
| 3217b568-9740-4520-b807-42f44091f06d | cirros-Image-test | active |
| 7bfa53ea-fe39-4d44-860a-b6495a5f24fc | cirros-Image      | active |
| 5acafbde-4493-4f00-acfa-18876453179e | xp3               | active |
| de680b57-f616-47e9-99f2-b5ed6dbf0e23 | Cirrus_ori        | active |
+--------------------------------------+-------------------+--------+
[root@openstack ~(keystone_admin)]# openstack image show cirros-Image
+------------------+------------------------------------------------------+
| Field            | Value                                                |
+------------------+------------------------------------------------------+
| checksum         | 443b7623e27ecf03dc9e01ee93f67afe                     |
| container_format | bare                                                 |
| created_at       | 2018-05-14T10:38:51Z                                 |
| disk_format      | qcow2                                                |
| file             | /v2/images/7bfa53ea-fe39-4d44-860a-b6495a5f24fc/file |
| id               | 7bfa53ea-fe39-4d44-860a-b6495a5f24fc                 |
| min_disk         | 0                                                    |
| min_ram          | 0                                                    |
| name             | cirros-Image                                         |
| owner            | 2d47b0d4fc8143e78185bd9a33957cc1                     |
| protected        | False                                                |
| schema           | /v2/schemas/image                                    |
| size             | 12716032                                             |
| status           | active                                               |
| tags             |                                                      |
| updated_at       | 2018-05-14T10:38:51Z                                 |
| virtual_size     | None                                                 |
| visibility       | public                                               |
+------------------+------------------------------------------------------+
[root@openstack ~(keystone_admin)]# openstack image show cirros-Image-test
+------------------+------------------------------------------------------+
| Field            | Value                                                |
+------------------+------------------------------------------------------+
| checksum         | 443b7623e27ecf03dc9e01ee93f67afe                     |
| container_format | bare                                                 |
| created_at       | 2018-05-17T03:20:46Z                                 |
| disk_format      | qcow2                                                |
| file             | /v2/images/3217b568-9740-4520-b807-42f44091f06d/file |
| id               | 3217b568-9740-4520-b807-42f44091f06d                 |
| min_disk         | 0                                                    |
| min_ram          | 0                                                    |
| name             | cirros-Image-test                                    |
| owner            | 2d47b0d4fc8143e78185bd9a33957cc1                     |
| protected        | False                                                |
| schema           | /v2/schemas/image                                    |
| size             | 12716032                                             |
| status           | active                                               |
| tags             |                                                      |
| updated_at       | 2018-05-17T03:20:46Z                                 |
| virtual_size     | None                                                 |
| visibility       | public                                               |
+------------------+------------------------------------------------------+
[root@openstack ~(keystone_admin)]#

10. Create Flavors
# source /root/keystonerc_admin
# openstack flavor create --id 6 --ram 1000 --disk 2 --vcpus 1 m1.testflavor
# openstack flavor list
# openstack flavor show m1.testflavor

sample
[root@openstack ~(keystone_admin)]# openstack flavor create --id 6 --ram 1000 --disk 2 --vcpus 1 m1.testflavor
+----------------------------+---------------+
| Field                      | Value         |
+----------------------------+---------------+
| OS-FLV-DISABLED:disabled   | False         |
| OS-FLV-EXT-DATA:ephemeral  | 0             |
| disk                       | 2             |
| id                         | 6             |
| name                       | m1.testflavor |
| os-flavor-access:is_public | True          |
| properties                 |               |
| ram                        | 1000          |
| rxtx_factor                | 1.0           |
| swap                       |               |
| vcpus                      | 1             |
+----------------------------+---------------+
[root@openstack ~(keystone_admin)]#

[root@openstack ~(keystone_teguht)]# openstack flavor list
+----+---------------+-------+------+-----------+-------+-----------+
| ID | Name          |   RAM | Disk | Ephemeral | VCPUs | Is Public |
+----+---------------+-------+------+-----------+-------+-----------+
| 1  | m1.tiny       |   512 |    1 |         0 |     1 | True      |
| 2  | m1.small      |  2048 |   20 |         0 |     1 | True      |
| 3  | m1.medium     |  4096 |   40 |         0 |     2 | True      |
| 4  | m1.large      |  8192 |   80 |         0 |     4 | True      |
| 5  | m1.xlarge     | 16384 |  160 |         0 |     8 | True      |
| 6  | m1.testflavor |  1000 |    2 |         0 |     1 | True      |
+----+---------------+-------+------+-----------+-------+-----------+
[root@openstack ~(keystone_teguht)]# openstack flavor show m1.testflavor
+----------------------------+---------------+
| Field                      | Value         |
+----------------------------+---------------+
| OS-FLV-DISABLED:disabled   | False         |
| OS-FLV-EXT-DATA:ephemeral  | 0             |
| access_project_ids         | None          |
| disk                       | 2             |
| id                         | 6             |
| name                       | m1.testflavor |
| os-flavor-access:is_public | True          |
| properties                 |               |
| ram                        | 1000          |
| rxtx_factor                | 1.0           |
| swap                       |               |
| vcpus                      | 1             |
+----------------------------+---------------+
[root@openstack ~(keystone_teguht)]#

11. create instance as example 2 instance(server)
# openstack server create --nic net-id=priv_net --security-group teguht-security --image cirros-Image --flavor m1.testflavor --key-name teguht-keypair --wait teguht-custom01
# openstack server create --nic net-id=priv_net --security-group teguht-security --image cirros-Image --flavor m1.testflavor --key-name teguht-keypair --wait teguht-custom02
# openstack server list
# openstack server show teguht-custom01
# openstack server show teguht-custom02

sample
[root@openstack data(keystone_teguht)]# openstack server create --nic net-id=priv_net --security-group teguht-security --image cirros-Image --flavor m1.testflavor --key-name teguht-keypair --wait teguht-custom

+--------------------------------------+----------------------------------------------------------+
| Field                                | Value                                                    |
+--------------------------------------+----------------------------------------------------------+
| OS-DCF:diskConfig                    | MANUAL                                                   |
| OS-EXT-AZ:availability_zone          | nova                                                     |
| OS-EXT-STS:power_state               | Running                                                  |
| OS-EXT-STS:task_state                | None                                                     |
| OS-EXT-STS:vm_state                  | active                                                   |
| OS-SRV-USG:launched_at               | 2018-05-14T10:33:56.000000                               |
| OS-SRV-USG:terminated_at             | None                                                     |
| accessIPv4                           |                                                          |
| accessIPv6                           |                                                          |
| addresses                            | priv_net=2.2.2.16                                        |
| adminPass                            | DZLa3nFwwgQy                                             |
| config_drive                         |                                                          |
| created                              | 2018-05-14T10:33:48Z                                     |
| flavor                               | m1.testflavor (6)                                        |
| hostId                               | 276d89873d80c369ef04a63c02362e6dde8b3186d23e3853f2b6954e |
| id                                   | 17b00a2b-d697-477f-a91e-845133a501d7                     |
| image                                | cirros-Image (c92c2545-d1e1-4c91-bfb6-6d06b895063a)      |
| key_name                             | teguht-keypair                                           |
| name                                 | teguht-custom                                            |
| os-extended-volumes:volumes_attached | []                                                       |
| progress                             | 0                                                        |
| project_id                           | 0fc7bb90bc714c8685108415557f08a2                         |
| properties                           |                                                          |
| security_groups                      | [{u'name': u'teguht-security'}]                          |
| status                               | ACTIVE                                                   |
| updated                              | 2018-05-14T10:33:56Z                                     |
| user_id                              | 8458f9a2a29f4c5d8f4e69fc066bd300                         |
+--------------------------------------+----------------------------------------------------------+
[root@openstack data(keystone_teguht)]#
[root@openstack ~(keystone_teguht)]# openstack server list
+--------------------------------------+-----------------+--------+---------------------------------+--------------+
| ID                                   | Name            | Status | Networks                        | Image Name   |
+--------------------------------------+-----------------+--------+---------------------------------+--------------+
| 326bf987-0af4-4e82-8669-2c849ceb0348 | teguht-custom02 | ACTIVE | priv_net=2.2.2.11, 172.30.1.11 | cirros-Image |
| 656fe67f-d9d3-4ff5-a880-3238cce3655f | teguht-custom01 | ACTIVE | priv_net=2.2.2.14, 172.30.1.15 | cirros-Image |
+--------------------------------------+-----------------+--------+---------------------------------+--------------+
[root@openstack ~(keystone_teguht)]# openstack server show teguht-custom01
+--------------------------------------+----------------------------------------------------------+
| Field                                | Value                                                    |
+--------------------------------------+----------------------------------------------------------+
| OS-DCF:diskConfig                    | MANUAL                                                   |
| OS-EXT-AZ:availability_zone          | nova                                                     |
| OS-EXT-STS:power_state               | Running                                                  |
| OS-EXT-STS:task_state                | None                                                     |
| OS-EXT-STS:vm_state                  | active                                                   |
| OS-SRV-USG:launched_at               | 2018-05-15T19:59:26.000000                               |
| OS-SRV-USG:terminated_at             | None                                                     |
| accessIPv4                           |                                                          |
| accessIPv6                           |                                                          |
| addresses                            | priv_net=2.2.2.14, 172.30.1.15                          |
| config_drive                         |                                                          |
| created                              | 2018-05-15T19:59:18Z                                     |
| flavor                               | m1.testflavor (6)                                        |
| hostId                               | 276d89873d80c369ef04a63c02362e6dde8b3186d23e3853f2b6954e |
| id                                   | 656fe67f-d9d3-4ff5-a880-3238cce3655f                     |
| image                                | cirros-Image (7bfa53ea-fe39-4d44-860a-b6495a5f24fc)      |
| key_name                             | teguht-keypair                                           |
| name                                 | teguht-custom01                                          |
| os-extended-volumes:volumes_attached | []                                                       |
| progress                             | 0                                                        |
| project_id                           | 0fc7bb90bc714c8685108415557f08a2                         |
| properties                           |                                                          |
| security_groups                      | [{u'name': u'teguht-security'}]                          |
| status                               | ACTIVE                                                   |
| updated                              | 2018-05-15T19:59:26Z                                     |
| user_id                              | 8458f9a2a29f4c5d8f4e69fc066bd300                         |
+--------------------------------------+----------------------------------------------------------+
[root@openstack ~(keystone_teguht)]# openstack server show teguht-custom02
+--------------------------------------+----------------------------------------------------------+
| Field                                | Value                                                    |
+--------------------------------------+----------------------------------------------------------+
| OS-DCF:diskConfig                    | MANUAL                                                   |
| OS-EXT-AZ:availability_zone          | nova                                                     |
| OS-EXT-STS:power_state               | Running                                                  |
| OS-EXT-STS:task_state                | None                                                     |
| OS-EXT-STS:vm_state                  | active                                                   |
| OS-SRV-USG:launched_at               | 2018-05-15T19:59:44.000000                               |
| OS-SRV-USG:terminated_at             | None                                                     |
| accessIPv4                           |                                                          |
| accessIPv6                           |                                                          |
| addresses                            | priv_net=2.2.2.11, 172.30.1.11                          |
| config_drive                         |                                                          |
| created                              | 2018-05-15T19:59:34Z                                     |
| flavor                               | m1.testflavor (6)                                        |
| hostId                               | 276d89873d80c369ef04a63c02362e6dde8b3186d23e3853f2b6954e |
| id                                   | 326bf987-0af4-4e82-8669-2c849ceb0348                     |
| image                                | cirros-Image (7bfa53ea-fe39-4d44-860a-b6495a5f24fc)      |
| key_name                             | teguht-keypair                                           |
| name                                 | teguht-custom02                                          |
| os-extended-volumes:volumes_attached | []                                                       |
| progress                             | 0                                                        |
| project_id                           | 0fc7bb90bc714c8685108415557f08a2                         |
| properties                           |                                                          |
| security_groups                      | [{u'name': u'teguht-security'}]                          |
| status                               | ACTIVE                                                   |
| updated                              | 2018-05-15T19:59:44Z                                     |
| user_id                              | 8458f9a2a29f4c5d8f4e69fc066bd300                         |
+--------------------------------------+----------------------------------------------------------+
[root@openstack ~(keystone_teguht)]#

12. add server floating ip
# source /root/keystonerc_teguht
# openstack server add floating ip teguht-custom01 172.30.1.15
# openstack server add floating ip teguht-custom02 172.30.1.11
sample
[root@openstack ~(keystone_teguht)]# openstack server add floating ip teguht-custom01 172.30.1.15
You have new mail in /var/spool/mail/root
[root@openstack ~(keystone_teguht)]# openstack server add floating ip teguht-custom02 172.30.1.11
[root@openstack ~(keystone_teguht)]#

13. Open console Instance 1(teguht-custom01 )and test ping IP
# hostname
# ping -c1 2.2.2.11
# ping -c1 172.30.1.11
# ping -c1 2.2.2.14
# ping -c1 172.30.1.15
# ping -c1 172.30.2.24
# ping -c1 8.8.8.8

[root@openstack ~(keystone_teguht)]# ssh cirros@172.30.1.15
The authenticity of host '172.30.1.15 (172.30.1.15)' can't be established.
ECDSA key fingerprint is SHA256:zMTpSeErWRSVdHlJl936TYuMY8sUwI2yxhD6HR8SDiI.
ECDSA key fingerprint is MD5:d0:d8:77:2d:27:0f:0f:98:c8:7f:cd:d8:0e:81:46:cc.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '172.30.1.15' (ECDSA) to the list of known hosts.
cirros@172.30.1.15's password:
$ hostname
teguht-custom01
$ ping -c1 2.2.2.11
PING 2.2.2.11 (2.2.2.11): 56 data bytes
64 bytes from 2.2.2.11: seq=0 ttl=64 time=32.071 ms

--- 2.2.2.11 ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 32.071/32.071/32.071 ms
$ ping -c1 2.2.2.14
PING 2.2.2.14 (2.2.2.14): 56 data bytes
64 bytes from 2.2.2.14: seq=0 ttl=64 time=19.510 ms

--- 2.2.2.14 ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 19.510/19.510/19.510 ms
$ ping -c1 172.30.1.11
PING 172.30.1.11 (172.30.1.11): 56 data bytes
64 bytes from 172.30.1.11: seq=0 ttl=63 time=1.728 ms

--- 172.30.1.11 ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 1.728/1.728/1.728 ms
$ ping -c1 172.30.1.15
PING 172.30.1.15 (172.30.1.15): 56 data bytes
64 bytes from 172.30.1.15: seq=0 ttl=63 time=1.902 ms

--- 172.30.1.15 ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 1.902/1.902/1.902 ms
$ ping -c1 172.30.1.24
PING 172.30.1.24 (172.30.1.24): 56 data bytes
64 bytes from 172.30.1.24: seq=0 ttl=125 time=15.278 ms

--- 172.30.1.24 ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 15.278/15.278/15.278 ms
$ ping -c1 8.8.8.8
PING 8.8.8.8 (8.8.8.8): 56 data bytes
64 bytes from 8.8.8.8: seq=0 ttl=53 time=23.257 ms

--- 8.8.8.8 ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 23.257/23.257/23.257 ms
$ exitConnection to 172.30.1.15 closed.
You have mail in /var/spool/mail/root
[root@openstack ~(keystone_teguht)]# 

14. Open console Instance 2(teguht-custom02 )and test ping IP
# hostname
# ping -c1 2.2.2.11
# ping -c1 172.30.1.11
# ping -c1 2.2.2.14
# ping -c1 172.30.1.15
# ping -c1 172.30.2.24
# ping -c1 8.8.8.8

[root@openstack ~(keystone_teguht)]# ssh cirros@172.30.1.11
The authenticity of host '172.30.1.11 (172.30.1.11)' can't be established.
ECDSA key fingerprint is SHA256:cTStLpL34qFr6lhsKdgQ2gnXgAmY+jVogb+cFEIGoLA.
ECDSA key fingerprint is MD5:ff:6b:71:41:ab:cc:77:88:7e:30:e4:89:84:a6:c7:e5.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '172.30.1.11' (ECDSA) to the list of known hosts.
cirros@172.30.1.11's password:
$ hostname
teguht-custom02
$ ping -c1 2.2.2.11
PING 2.2.2.11 (2.2.2.11): 56 data bytes
64 bytes from 2.2.2.11: seq=0 ttl=64 time=65.375 ms

--- 2.2.2.11 ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 65.375/65.375/65.375 ms
$ ping -c1 2.2.2.14
PING 2.2.2.14 (2.2.2.14): 56 data bytes
64 bytes from 2.2.2.14: seq=0 ttl=64 time=76.163 ms

--- 2.2.2.14 ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 76.163/76.163/76.163 ms
$ ping -c1 172.30.1.11
PING 172.30.1.11 (172.30.1.11): 56 data bytes
64 bytes from 172.30.1.11: seq=0 ttl=63 time=87.308 ms

--- 172.30.1.11 ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 87.308/87.308/87.308 ms
$ ping -c1 172.30.1.15
PING 172.30.1.15 (172.30.1.15): 56 data bytes
64 bytes from 172.30.1.15: seq=0 ttl=63 time=71.663 ms

--- 172.30.1.15 ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 71.663/71.663/71.663 ms
$ ping -c1 172.30.1.24
PING 172.30.1.24 (172.30.1.24): 56 data bytes
64 bytes from 172.30.1.24: seq=0 ttl=125 time=44.970 ms

--- 172.30.1.24 ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 44.970/44.970/44.970 ms
$ cat /etc/hosts
127.0.0.1    localhost
127.0.1.1    cirros
$ exit
Connection to 172.30.1.11 closed.
You have mail in /var/spool/mail/root
[root@openstack ~(keystone_teguht)]#

15. Check Network Topology for your project


16. Detail lab as

No comments:

Post a Comment

Popular Posts