Managing Images

Hi… Lanjut lagi COA series nya. Kali ini kita akan coba manage images, kita akan mencoba menambahkan images CloudHostRouter Mikrotik (chr-6.3.5).

Pertama, kita download dulu image nya

[[email protected] centos(keystone_admin)]# wget https://download.mikrotik.com/routeros/6.35/chr-6.35.img

Cek dulu command yang ada untuk image ini apa saja, dengan –help

[[email protected] centos(keystone_admin)]# openstack image --help
Command "image" matches:
 image add project
 image create
 image delete
 image list
 image remove project
 image save
 image set
 image show
 image unset

Cek image yang ada

[[email protected] centos(keystone_admin)]# openstack image list
+--------------------------------------+--------+--------+
| ID                                   | Name   | Status |
+--------------------------------------+--------+--------+
| f19d4585-ca73-44a4-9458-61ae2c031318 | cirros | active |
+--------------------------------------+--------+--------+

Create image

[[email protected] centos(keystone_admin)]# openstack image create --disk-format qcow2 --project konfigurasi --file /home/centos/chr-6.35.img chr-konfigurasi +------------------+------------------------------------------------------+
| Field | Value |
+------------------+------------------------------------------------------+
| checksum | 6df7b1c7d9c82757ca230417229f0439 |
| container_format | bare |
| created_at | 2018-04-05T13:22:06Z |
| disk_format | qcow2 |
| file | /v2/images/1f5f94b6-ccc0-4238-b671-1253b990d29b/file |
| id | 1f5f94b6-ccc0-4238-b671-1253b990d29b |
| min_disk | 0 |
| min_ram | 0 |
| name | chr-konfigurasi |
| owner | 84268f39f25148739783ca2247b7ba21 |
| protected | False |
| schema | /v2/schemas/image |
| size | 134217728 |
| status | active |
| tags | |
| updated_at | 2018-04-05T13:22:09Z |
| virtual_size | None |
| visibility | shared |
+------------------+------------------------------------------------------+

Kemudian, cek apakah sudah ada dilist

[[email protected] centos(keystone_admin)]# openstack image list
+--------------------------------------+-----------------+--------+
| ID                                   | Name            | Status |
+--------------------------------------+-----------------+--------+
| 1f5f94b6-ccc0-4238-b671-1253b990d29b | chr-konfigurasi | active |
| f19d4585-ca73-44a4-9458-61ae2c031318 | cirros          | active |
+--------------------------------------+-----------------+--------+

Selanjutnya, kita cek detailnya

[[email protected] centos(keystone_admin)]# openstack image show chr-konfigurasi
+------------------+------------------------------------------------------+
| Field            | Value                                                |
+------------------+------------------------------------------------------+
| checksum         | 6df7b1c7d9c82757ca230417229f0439                     |
| container_format | bare                                                 |
| created_at       | 2018-04-05T13:22:06Z                                 |
| disk_format      | qcow2                                                |
| file             | /v2/images/1f5f94b6-ccc0-4238-b671-1253b990d29b/file |
| id               | 1f5f94b6-ccc0-4238-b671-1253b990d29b                 |
| min_disk         | 0                                                    |
| min_ram          | 0                                                    |
| name             | chr-konfigurasi                                      |
| owner            | 84268f39f25148739783ca2247b7ba21                     |
| protected        | False                                                |
| schema           | /v2/schemas/image                                    |
| size             | 134217728                                            |
| status           | active                                               |
| tags             |                                                      |
| updated_at       | 2018-04-05T13:22:09Z                                 |
| virtual_size     | None                                                 |
| visibility       | shared                                               |
+------------------+------------------------------------------------------+

Untuk merubah parameter yang ada ditabel, menggunakan command set

[[email protected] centos(keystone_admin)]# openstack image set --help
usage: openstack image set [-h] [--name <name>] [--min-disk <disk-gb>]
 [--min-ram <ram-mb>]
 [--container-format <container-format>]
 [--disk-format <disk-format>]
 [--protected | --unprotected]
 [--public | --private | --community | --shared]
 [--property <key=value>] [--tag <tag>]
 [--architecture <architecture>]
 [--instance-id <instance-id>]
 [--kernel-id <kernel-id>] [--os-distro <os-distro>]
 [--os-version <os-version>]
 [--ramdisk-id <ramdisk-id>]
 [--deactivate | --activate] [--project <project>]
 [--project-domain <project-domain>]
 [--accept | --reject | --pending]
 <image>

Sekarang, kita coba untuk set  visibility nya menjadi public, minimum ram 256mb dan minimum disk 1G

[[email protected] centos(keystone_admin)]# openstack image set --public --min-ram 256 --min-disk 1 chr-konfigurasi
[[email protected] centos(keystone_admin)]# openstack image show chr-konfigurasi
+------------------+------------------------------------------------------+
| Field            | Value                                                |
+------------------+------------------------------------------------------+
| checksum         | 6df7b1c7d9c82757ca230417229f0439                     |
| container_format | bare                                                 |
| created_at       | 2018-04-05T13:22:06Z                                 |
| disk_format      | qcow2                                                |
| file             | /v2/images/1f5f94b6-ccc0-4238-b671-1253b990d29b/file |
| id               | 1f5f94b6-ccc0-4238-b671-1253b990d29b                 |
| min_disk         | 1                                                    |
| min_ram          | 256                                                  |
| name             | chr-konfigurasi                                      |
| owner            | 84268f39f25148739783ca2247b7ba21                     |
| protected        | False                                                |
| schema           | /v2/schemas/image                                    |
| size             | 134217728                                            |
| status           | active                                               |
| tags             |                                                      |
| updated_at       | 2018-04-06T03:25:16Z                                 |
| virtual_size     | None                                                 |
| visibility       | public                                               |
+------------------+------------------------------------------------------+

Sekarang kita akan coba save image yang sudah ada sebelumnya, yaitu cirros di local disk

[[email protected] centos(keystone_admin)]# openstack image save --file cirros.img cirros
[[email protected] centos(keystone_admin)]# ls
bll-8-xfce-x86_64.iso cirros.img
chr-6.35.img ubuntu-16.04.3-server-amd64.iso

Untuk menghapus, menggunakan command delete

[[email protected] centos(keystone_admin)]# openstack image delete chr-konfigurasi

Untuk manage menggunakan dashboard silahkan coba sendiri ya…. Terima Kasih

 

 

 

Managing Groups and Domains

Hi….

Lanjut lagi COA series nya ya, maaf sebelumnya karena updatenya lama, karena laptop bermasalah.

Groups

Groups adalah cara mudah untuk memanage users yang membutuhkan roles yang sama. Untuk melihat perintah apa yang tersedia, mari check dengan help:

[[email protected] centos(keystone_admin)]# openstack group --help
Command "group" matches:
 group add user
 group contains user
 group create
 group delete
 group list
 group remove user
 group set
 group show

Kita coba lihat lebih detail pada “create” dengan command :

[[email protected] centos(keystone_admin)]# openstack group create --help
usage: openstack group create [-h] [-f {json,shell,table,value,yaml}]
 [-c COLUMN] [--max-width <integer>]
 [--fit-width] [--print-empty] [--noindent]
 [--prefix PREFIX] [--domain <domain>]
 [--description <description>] [--or-show]
 <group-name>

Sekarang, kita coba create

[[email protected] centos(keystone_admin)]# openstack group create support
+-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| description |                                  |
| domain_id   | default                          |
| id          | 80bf27af59cb4db095f6b5d0844b8c1a |
| name        | support                          |
+-------------+----------------------------------+

Sekarang, kita coba set “description”, kemudian cek hasilnya

[[email protected] centos(keystone_admin)]# openstack group set --description "Konfigurasi Support Group" support
[[email protected] centos(keystone_admin)]# openstack group show support
+-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| description | Konfigurasi Support Group        |
| domain_id   | default                          |
| id          | 80bf27af59cb4db095f6b5d0844b8c1a |
| name        | support                          |
+-------------+----------------------------------+

Nah, sekarang kita coba create user support_konfigurasi, kemudian masukan ke project konfigurasi, role _member_ dan group support

[[email protected] centos(keystone_admin)]# openstack user create --password-prompt support_konfigurasi
User Password:
Repeat User Password:
+---------------------+----------------------------------+
| Field               | Value                            |
+---------------------+----------------------------------+
| domain_id           | default                          |
| enabled             | True                             |
| id                  | 167f0bcb0dae41698e12e1020e86f536 |
| name                | support_konfigurasi              |
| options             | {}                               |
| password_expires_at | None                             |
+---------------------+----------------------------------+
[[email protected] centos(keystone_admin)]# openstack role add --project konfigurasi --user support_konfigurasi _member_
[[email protected] centos(keystone_admin)]# openstack group add user support support_konfigurasi
[[email protected] centos(keystone_admin)]# openstack group contains user support support_konfigurasi
support_konfigurasi in group support

Untuk menghapus user dari group gunakan command

[[email protected] centos(keystone_admin)]# openstack group remove user support

Kemudian, untuk menghapus group

[[email protected] centos(keystone_admin)]# openstack group delete support

Domains

Domain hanya dapat dimanage dengan cli saja, berikut command yang ada di domain

[[email protected] centos(keystone_admin)]# openstack domain --help
Command "domain" matches:
 domain create
 domain delete
 domain list
 domain set
 domain show

Dan untuk melihat lebih detail salah satu nya

[[email protected] centos(keystone_admin)]# openstack domain create --help

Sekarang kita coba buat domain

[[email protected] centos(keystone_admin)]# openstack domain create supports
+-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| description |                                  |
| enabled     | True                             |
| id          | 1687d2eff35c4a8e93167da9019e06ab |
| name        | supports                         |
+-------------+----------------------------------+

Kita coba beri deskripsi nya dan cek setelah set deskripsi

[[email protected] centos(keystone_admin)]# openstack domain set --description "Konfigurasi Support Domain" supports
[[email protected] centos(keystone_admin)]# openstack domain show supports
+-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| description | Konfigurasi Support Domain       |
| enabled     | True                             |
| id          | 1687d2eff35c4a8e93167da9019e06ab |
| name        | supports                         |
+-------------+----------------------------------+

Juga bisa cek dengan command

[[email protected] centos(keystone_admin)]# openstack domain list
+----------------------------------+----------+---------+----------------------------+
| ID                               | Name     | Enabled | Description                |
+----------------------------------+----------+---------+----------------------------+
| 1687d2eff35c4a8e93167da9019e06ab | supports | True    | Konfigurasi Support Domain |
| default                          | Default  | True    | The default domain         |
+----------------------------------+----------+---------+----------------------------+

Untuk project, user dll tidak bisa dipindahkan dari domain satu ke yang lain. Hanya bisa dibuat didalam domain.

Oleh karena itu, sekarang kita coba create project dan user yang baru

[[email protected] centos(keystone_admin)]# openstack project create --domain supports Support
+-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| description |                                  |
| domain_id   | 1687d2eff35c4a8e93167da9019e06ab |
| enabled     | True                             |
| id          | 78343f30e9bd4fc6be433b7c070f7d6a |
| is_domain   | False                            |
| name        | Support                          |
| parent_id   | 1687d2eff35c4a8e93167da9019e06ab |
+-------------+----------------------------------+
[[email protected] centos(keystone_admin)]# openstack project list
+----------------------------------+-------------+
| ID                               | Name        |
+----------------------------------+-------------+
| 684756bc533142b7b6c83aa142919955 | services    |
| 78343f30e9bd4fc6be433b7c070f7d6a | Support     |
| 84268f39f25148739783ca2247b7ba21 | konfigurasi |
| 96f6342313114f2094488ec528c6a782 | demo        |
| 9db0b4d06d0548ff96d10845fe44e3b6 | admin       |
+----------------------------------+-------------+
[[email protected] centos(keystone_admin)]# openstack user create --domain supports ade --password-prompt
User Password:
Repeat User Password:
+---------------------+----------------------------------+
| Field               | Value                            |
+---------------------+----------------------------------+
| domain_id           | 1687d2eff35c4a8e93167da9019e06ab |
| enabled             | True                             |
| id                  | 953a6cc02b0840189e6d8c88699bd33b |
| name                | ade                              |
| options             | {}                               |
| password_expires_at | None                             |
+---------------------+----------------------------------+
[[email protected] centos(keystone_admin)]# openstack user list
+----------------------------------+---------------------+
| ID                               | Name                |
+----------------------------------+---------------------+
| 167f0bcb0dae41698e12e1020e86f536 | support_konfigurasi |
| 23e4b8d17ec34921a44419fb243e2e9f | aodh                |
| 2aa274d6a1fc487c9620ba1c2ce3b185 | admin_konfigurasi   |
| 3261551f781840bcb52ac7e403717e1c | glance              |
| 3eb5ec95b83e424bbee3ade5ee43f737 | neutron             |
| 6b1887d907aa4920afc848db9707c431 | admin               |
| 6d3ec2aa483f4cb598bfdb7a5394dd69 | ceilometer          |
| 76abbdc01fe741d8976fc49ded6093d4 | swift               |
| 8301050d83804fe399e3731b0979f144 | demo                |
| 84af867a7810494e8dd837fe05d05f1b | gnocchi             |
| 93c6646c3d654084abb2710971e846db | nova                |
| 946edb0acc2d4b97bffffbaee8ff3474 | placement           |
| 953a6cc02b0840189e6d8c88699bd33b | ade                 |
| ac80bdff114a4b82a7afbf34c3949cf1 | cinder              |
+----------------------------------+---------------------+