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

[root@localhost 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

[root@localhost 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

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

Create image

[root@localhost 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

[root@localhost 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

[root@localhost 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

[root@localhost 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

[root@localhost centos(keystone_admin)]# openstack image set --public --min-ram 256 --min-disk 1 chr-konfigurasi
[root@localhost 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

[root@localhost centos(keystone_admin)]# openstack image save --file cirros.img cirros
[root@localhost 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

[root@localhost centos(keystone_admin)]# openstack image delete chr-konfigurasi

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

 

 

 

Leave a Reply

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