Konfigurasi Data Nusantara

OpenStackVirtualisasi - Cloud

Managing Services and Endpoints

Hi…

Kali ini kita akan coba manage services dan endpoints pada openstack, dalam rangka belajar persiapan ujian sertifikasi “Certified OpenStack Assosiation” atau COA. Pada lab-lab seri ini akan menggunakan Packstack yang sebelumnya pernah dibahas instalasi nya

Services

Sebelum mulai, mari kita lihat perintah (command) apa saja yang tersedia untuk services ini

[root@localhost centos(keystone_admin)]# openstack service --help
Command "service" matches:
 service create
 service delete
 service list
 service provider create
 service provider delete
 service provider list
 service provider set
 service provider show
 service set
 service show

Command-command yang nanti nya akan berkaitan dengan “Certified OpenStack Assosiation”/”COA” adalah create, delete, list, set dan show.

Sedangkan service yang tersedia pada OpenStack lab ini adalah

[root@localhost centos(keystone_admin)]# openstack service list
+----------------------------------+------------+--------------+
| ID                               | Name       | Type         |
+----------------------------------+------------+--------------+
| 4638c5afe21849bc8c8a5ae23b1247ad | swift      | object-store |
| 47bbe95a46d64fa4a16e0ba31e11477d | glance     | image        |
| 4aa6673ac7274af6a3a33f3786dc283d | neutron    | network      |
| 4dd00a2881ff4d77b991805fed98324b | cinderv2   | volumev2     |
| 51478dbf3a6049b5b5a96f45563d6d5a | gnocchi    | metric       |
| 53a7ace8b7884cf9b16b72307951a844 | cinderv3   | volumev3     |
| 5f5e45b027324b83bc815e9affd7880f | ceilometer | metering     |
| 7b48aacfe5a7402f8f5f7386ea381181 | cinder     | volume       |
| 878bcec6b57d4f0c92889ce46f8935e3 | nova       | compute      |
| 95bf98c0187d4c85af0660e76b4e402c | aodh       | alarming     |
| c3b74bb96871461f86057f152a68a214 | placement  | placement    |
| ff960fe547514cadaf6478709dff8d43 | keystone   | identity     |
+----------------------------------+------------+--------------+

Untuk menambahkan service pada openstack, menggunakan command

openstack service create --name <servicename> --description "<description>" <service type>

Sebagai contoh, kita akan membuat service name blog dengan tipe website, 

[root@localhost centos(keystone_admin)]# openstack service create --name blog --description "OpenStack Web Blog" website
+-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| description | OpenStack Web Blog               |
| enabled     | True                             |
| id          | 9e4bc7ed4ca544dbad43e3775bf16b85 |
| name        | blog                             |
| type        | website                          |
+-------------+----------------------------------+

Untuk verifikasi service yang dibuat sudah ditambahkan, gunakan perintah

[root@localhost centos(keystone_admin)]# openstack service list
+----------------------------------+------------+--------------+
| ID                               | Name       | Type         |
+----------------------------------+------------+--------------+
| 4638c5afe21849bc8c8a5ae23b1247ad | swift      | object-store |
| 47bbe95a46d64fa4a16e0ba31e11477d | glance     | image        |
| 4aa6673ac7274af6a3a33f3786dc283d | neutron    | network      |
| 4dd00a2881ff4d77b991805fed98324b | cinderv2   | volumev2     |
| 51478dbf3a6049b5b5a96f45563d6d5a | gnocchi    | metric       |
| 53a7ace8b7884cf9b16b72307951a844 | cinderv3   | volumev3     |
| 5f5e45b027324b83bc815e9affd7880f | ceilometer | metering     |
| 7b48aacfe5a7402f8f5f7386ea381181 | cinder     | volume       |
| 878bcec6b57d4f0c92889ce46f8935e3 | nova       | compute      |
| 95bf98c0187d4c85af0660e76b4e402c | aodh       | alarming     |
| 9e4bc7ed4ca544dbad43e3775bf16b85 | blog       | website      |
| c3b74bb96871461f86057f152a68a214 | placement  | placement    |
| ff960fe547514cadaf6478709dff8d43 | keystone   | identity     |
+----------------------------------+------------+--------------+

Dan apabila ingin menghapus, gunakan command openstack service delete blog, kemudian cek apakah sudah terhapus

[root@localhost centos(keystone_admin)]# openstack service delete blog
[root@localhost centos(keystone_admin)]# openstack service list
+----------------------------------+------------+--------------+
| ID                               | Name       | Type         |
+----------------------------------+------------+--------------+
| 4638c5afe21849bc8c8a5ae23b1247ad | swift      | object-store |
| 47bbe95a46d64fa4a16e0ba31e11477d | glance     | image        |
| 4aa6673ac7274af6a3a33f3786dc283d | neutron    | network      |
| 4dd00a2881ff4d77b991805fed98324b | cinderv2   | volumev2     |
| 51478dbf3a6049b5b5a96f45563d6d5a | gnocchi    | metric       |
| 53a7ace8b7884cf9b16b72307951a844 | cinderv3   | volumev3     |
| 5f5e45b027324b83bc815e9affd7880f | ceilometer | metering     |
| 7b48aacfe5a7402f8f5f7386ea381181 | cinder     | volume       |
| 878bcec6b57d4f0c92889ce46f8935e3 | nova       | compute      |
| 95bf98c0187d4c85af0660e76b4e402c | aodh       | alarming     |
| c3b74bb96871461f86057f152a68a214 | placement  | placement    |
| ff960fe547514cadaf6478709dff8d43 | keystone   | identity     |
+----------------------------------+------------+--------------+

Sekarang kita coba create kembali

[root@localhost centos(keystone_admin)]# openstack service create --name blog --description "Konfigrasi Web Blog" website
+-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| description | Konfigrasi Web Blog              |
| enabled     | True                             |
| id          | 3e332535a741424780ab9ce6579067fb |
| name        | blog                             |
| type        | website                          |
+-------------+----------------------------------+

Apabila ada kesalahan pengetikan, kita dapat merubah dengan command set

[root@localhost centos(keystone_admin)]# openstack service set --description "Konfigurasi Web Blog" blog

Kemudian kita cek, apakah description sudah berubah

[root@localhost centos(keystone_admin)]# openstack service show blog
+-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| description | Konfigurasi Web Blog             |
| enabled     | True                             |
| id          | 3e332535a741424780ab9ce6579067fb |
| name        | blog                             |
| type        | website                          |
+-------------+----------------------------------+

Terakhir, cek apakah service yang dibuat sudah ada

+----------------------------------+------------+--------------+
| ID                               | Name       | Type         |
+----------------------------------+------------+--------------+
| 3e332535a741424780ab9ce6579067fb | blog       | website      |
| 4638c5afe21849bc8c8a5ae23b1247ad | swift      | object-store |
| 47bbe95a46d64fa4a16e0ba31e11477d | glance     | image        |
| 4aa6673ac7274af6a3a33f3786dc283d | neutron    | network      |
| 4dd00a2881ff4d77b991805fed98324b | cinderv2   | volumev2     |
| 51478dbf3a6049b5b5a96f45563d6d5a | gnocchi    | metric       |
| 53a7ace8b7884cf9b16b72307951a844 | cinderv3   | volumev3     |
| 5f5e45b027324b83bc815e9affd7880f | ceilometer | metering     |
| 7b48aacfe5a7402f8f5f7386ea381181 | cinder     | volume       |
| 878bcec6b57d4f0c92889ce46f8935e3 | nova       | compute      |
| 95bf98c0187d4c85af0660e76b4e402c | aodh       | alarming     |
| c3b74bb96871461f86057f152a68a214 | placement  | placement    |
| ff960fe547514cadaf6478709dff8d43 | keystone   | identity     |
+----------------------------------+------------+--------------+

Command yang sama berlaku pula pada endpoints, projects, users, roles, dll. Untuk pengecekan, gunakan help, sebagai contoh pada endpoint

openstack endpoint delete --help

atau

openstack endpoint set --help 
  

Endpoints

[root@localhost centos(keystone_admin)]# openstack endpoint --help
Command "endpoint" matches:
 endpoint create
 endpoint delete
 endpoint list
 endpoint set
 endpoint show

Sebelum melanjutkan, kita cek dulu endpoint yang ada

[root@localhost centos(keystone_admin)]# openstack endpoint list
+----------------------------------+-----------+--------------+--------------+---------+-----------+---------------------------------------------------+
| ID                               | Region    | Service Name | Service Type | Enabled | Interface | URL                                               |
+----------------------------------+-----------+--------------+--------------+---------+-----------+---------------------------------------------------+
| 0223b2d8eca04508a6f1ddf2b2d001e6 | RegionOne | ceilometer   | metering     | True    | internal  | http://192.168.192.168:8777                       |
| 043b0f63655649ffa4c6e2222879def6 | RegionOne | neutron      | network      | True    | public    | http://192.168.192.168:9696                       |
| 1b0d3036fedd44f7a3aeea97c046a1e7 | RegionOne | glance       | image        | True    | admin     | http://192.168.192.168:9292                       |
| 1b346ef5b052461baeda7971b127a5df | RegionOne | placement    | placement    | True    | public    | http://192.168.192.168:8778/placement             |
| 1ceb0e6c2e9e486d8d7c81c4b8c18763 | RegionOne | nova         | compute      | True    | public    | http://192.168.192.168:8774/v2.1/%(tenant_id)s    |
| 287889a851894294a1939c942ba91164 | RegionOne | cinderv2     | volumev2     | True    | internal  | http://192.168.192.168:8776/v2/%(tenant_id)s      |
| 2ace754bf6a44a8f95915abd615e809c | RegionOne | keystone     | identity     | True    | internal  | http://192.168.192.168:5000/v3                    |
| 33a50851b67e444f9fc55c2261aadcba | RegionOne | cinderv3     | volumev3     | True    | public    | http://192.168.192.168:8776/v3/%(tenant_id)s      |
| 33d3be6d24a04759b14aec72961552f8 | RegionOne | swift        | object-store | True    | internal  | http://192.168.192.168:8080/v1/AUTH_%(tenant_id)s |
| 3683f2d29ea24f1599f005bf66a94637 | RegionOne | cinderv2     | volumev2     | True    | admin     | http://192.168.192.168:8776/v2/%(tenant_id)s      |
| 389d4d466dd64248893b93311ac555cb | RegionOne | keystone     | identity     | True    | admin     | http://192.168.192.168:35357/v3                   |
| 3c751d607f89413bb57936bffcb62795 | RegionOne | ceilometer   | metering     | True    | public    | http://192.168.192.168:8777                       |
| 4655804992f14c659d83981f1afd3cb6 | RegionOne | gnocchi      | metric       | True    | internal  | http://192.168.192.168:8041                       |
| 4bb49f0dea5c4525b2335004b7f98abf | RegionOne | glance       | image        | True    | public    | http://192.168.192.168:9292                       |
| 5a34ee5848d041179528fcb3342d542f | RegionOne | neutron      | network      | True    | internal  | http://192.168.192.168:9696                       |
| 69193c89863d4f42a9fe236a08c8a376 | RegionOne | nova         | compute      | True    | admin     | http://192.168.192.168:8774/v2.1/%(tenant_id)s    |
| 6a39f1ffcf3d4633a31312ee6ae2416d | RegionOne | cinderv2     | volumev2     | True    | public    | http://192.168.192.168:8776/v2/%(tenant_id)s      |
| 6b6d121a8082473895d9d9f2d5e77580 | RegionOne | placement    | placement    | True    | admin     | http://192.168.192.168:8778/placement             |
| 7424c0ad3abb47b08b47060d5cb826b5 | RegionOne | glance       | image        | True    | internal  | http://192.168.192.168:9292                       |
| 76dc61d2e10e4dfca003578b5c51eb20 | RegionOne | gnocchi      | metric       | True    | admin     | http://192.168.192.168:8041                       |
| 779285ef656c4f10b6a3c9a6cf06c5f7 | RegionOne | keystone     | identity     | True    | public    | http://192.168.192.168:5000/v3                    |
| 997bc548ebb5419dbf74da3b7d745848 | RegionOne | cinder       | volume       | True    | internal  | http://192.168.192.168:8776/v1/%(tenant_id)s      |
| a9874fea020b4d8c974f30bde7f4497e | RegionOne | aodh         | alarming     | True    | internal  | http://192.168.192.168:8042                       |
| aa58c206e6e04656925a61327cd1f7cd | RegionOne | swift        | object-store | True    | public    | http://192.168.192.168:8080/v1/AUTH_%(tenant_id)s |
| b1efd5bfa7fb4299b3d24f811162dd41 | RegionOne | ceilometer   | metering     | True    | admin     | http://192.168.192.168:8777                       |
| b763a9e0778f422d97c0936b63eb05b0 | RegionOne | placement    | placement    | True    | internal  | http://192.168.192.168:8778/placement             |
| b83a1d4184974fd292184fbbe568f5d5 | RegionOne | cinder       | volume       | True    | admin     | http://192.168.192.168:8776/v1/%(tenant_id)s      |
| b886d2a320f94505a81dbb07954f8297 | RegionOne | cinderv3     | volumev3     | True    | admin     | http://192.168.192.168:8776/v3/%(tenant_id)s      |
| b8d0800cdde24329a30ff87579049fd7 | RegionOne | cinderv3     | volumev3     | True    | internal  | http://192.168.192.168:8776/v3/%(tenant_id)s      |
| d22488e6bdc249ffb55168ebbf415034 | RegionOne | cinder       | volume       | True    | public    | http://192.168.192.168:8776/v1/%(tenant_id)s      |
| d425c7caebe041c5a20eaac0d3df464d | RegionOne | neutron      | network      | True    | admin     | http://192.168.192.168:9696                       |
| d529c5821e834966800e5e90c307c704 | RegionOne | nova         | compute      | True    | internal  | http://192.168.192.168:8774/v2.1/%(tenant_id)s    |
| d80035fd8a0a4c1789475fc797aebd83 | RegionOne | gnocchi      | metric       | True    | public    | http://192.168.192.168:8041                       |
| f4dbf7c76d1b41829519acef880e31d4 | RegionOne | swift        | object-store | True    | admin     | http://192.168.192.168:8080/v1/AUTH_%(tenant_id)s |
| f53aada0b5e34130ab022743083b496a | RegionOne | aodh         | alarming     | True    | public    | http://192.168.192.168:8042                       |
| f8ac4da8dd3742efa8b4160487d8f77d | RegionOne | aodh         | alarming     | True    | admin     | http://192.168.192.168:8042                       |
+----------------------------------+-----------+--------------+--------------+---------+-----------+---------------------------------------------------+

Ok, sekarang kita lanjut membuat endpoint untuk service blog menggunakan ip dan port pada openstack lab kali ini. Seperti yang kita lihat sebelumnya, ada 3 tipe interface, yaitu admin, internal dan public, nah kita akan buat masing2 terpisah dengan port yang berbeda, yaitu port 911 (admin), 912 (internal) dan 913 (public).

[root@localhost centos(keystone_admin)]# openstack endpoint create --region RegionOne blog admin http://192.168.192.168:911
+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | 59be2b0e05fa4c4785d714cbcba66e2b |
| interface    | admin                            |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | 3e332535a741424780ab9ce6579067fb |
| service_name | blog                             |
| service_type | website                          |
| url          | http://192.168.192.168:911       |
+--------------+----------------------------------+
[root@localhost centos(keystone_admin)]# openstack endpoint create --region RegionOne blog internal http://192.168.192.168:912
+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | 1f84728c3e5243f69271a05208cad7fa |
| interface    | internal                         |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | 3e332535a741424780ab9ce6579067fb |
| service_name | blog                             |
| service_type | website                          |
| url          | http://192.168.192.168:912       |
+--------------+----------------------------------+
[root@localhost centos(keystone_admin)]# openstack endpoint create --region RegionOne blog public http://192.168.192.168:913
+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | 64c76427e0da4af5b9aa0ee97cbc35a7 |
| interface    | public                           |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | 3e332535a741424780ab9ce6579067fb |
| service_name | blog                             |
| service_type | website                          |
| url          | http://192.168.192.168:913       |
+--------------+----------------------------------+

Apabila ingin menghapus dapat menggunakan command

 openstack endpoint delete <id>

Contoh, ingin menghapus pada public

[root@localhost centos(keystone_admin)]# openstack endpoint delete 64c76427e0da4af5b9aa0ee97cbc35a7

Sekarang, kita create ulang

[root@localhost centos(keystone_admin)]# openstack endpoint create --region RegionOne blog public http: //192.168.192.168:914
+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | 0d899074858d4f12973fd39153d41ce7 |
| interface    | public                           |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | 3e332535a741424780ab9ce6579067fb |
| service_name | blog                             |
| service_type | website                          |
| url          | http://192.168.192.168:914       |
+--------------+----------------------------------+

Untuk merubah menggunakan command set

[root@localhost centos(keystone_admin)]# openstack endpoint set 0d899074858d4f12973fd39153d41ce7 --url http://192.168.192.168:913

Untuk cek tiap endpoint dapat menggunakan command

[root@localhost centos(keystone_admin)]# openstack endpoint show 0d899074858d4f12973fd39153d41ce7
+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | 0d899074858d4f12973fd39153d41ce7 |
| interface    | public                           |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | 3e332535a741424780ab9ce6579067fb |
| service_name | blog                             |
| service_type | website                          |
| url          | http://192.168.192.168:913       |
+--------------+----------------------------------+

Sekarang kita cek semua endpoint untuk service blog

[root@localhost centos(keystone_admin)]# openstack endpoint list --service blog
+----------------------------------+-----------+--------------+--------------+---------+-----------+----------------------------+
| ID                               | Region    | Service Name | Service Type | Enabled | Interface | URL                        |
+----------------------------------+-----------+--------------+--------------+---------+-----------+----------------------------+
| 0d899074858d4f12973fd39153d41ce7 | RegionOne | blog         | website      | True    | public    | http://192.168.192.168:913 |
| 1f84728c3e5243f69271a05208cad7fa | RegionOne | blog         | website      | True    | internal  | http://192.168.192.168:912 |
| 59be2b0e05fa4c4785d714cbcba66e2b | RegionOne | blog         | website      | True    | admin     | http://192.168.192.168:911 |
+----------------------------------+-----------+--------------+--------------+---------+-----------+----------------------------+

Apabila ingin cek pada dashboard ada di menu Admin, kemudian System, kemudian System Information

Have any Question or Comment?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.