Customize Cloud Disk Image using Virt-Customize| Memodifikasi Cloud Disk Image Menggunakan Virt-Customize| Home Lab

Instalasi Libguestfs-tools

# yum -y install libguestfs-tools-c.x86_64
# export LIBGUESTFS_BACKEND=direct

Modifikasi Image Menggunakan Virt-customize

# wget http://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud.qcow2 -O ~/CentOS-7-x86_64.qcow2
# virt-customize -a ~/CentOS-7-x86_64.qcow2 \
--run-command 'yum -y install httpd' \
--run-command 'systemctl enable httpd' \
--run-command 'systemctl is-enabled httpd' \
--run-command 'useradd user-guestfish' \
--selinux-relabel

Unggah Image Modifikasi ke Glance

# openstack image create \
--disk-format qcow2 \
--container-format bare \
--public \
--file CentOS-7-x86_64.qcow2 \
CentOS-7_Custom

Buat Instance/Server

# openstack server create \
--image CentOS-7_Custom \
--flavor m1.small \
--network private \
--security-group my_secgroup \
--key-name my_key \
myserver
# openstack floating ip create --project <project_name> --subnet <public_subnet> public
# openstack floating ip list -c "Floating IP Address" -c Port
# openstack server add floating ip myserver <floating_ip_address>

Pengecekan Image

# openstack server list
# curl <ip_address_server>

--

--

Cloud Consultant | RHCSA | RHCE in Red Hat OpenStack | Google Cloud ACE | AWS SAA | LinkedIn: https://www.linkedin.com/in/achchusnulchikam

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Ach.Chusnul Chikam

Ach.Chusnul Chikam

26 Followers

Cloud Consultant | RHCSA | RHCE in Red Hat OpenStack | Google Cloud ACE | AWS SAA | LinkedIn: https://www.linkedin.com/in/achchusnulchikam