OpenStack Flamingo : Add VM images to Glance2025/11/18 |
|
Add Virtual Machine images to Glance. |
|
| [1] | For example, Create a Virtual Machine image of ubuntu 24.04. |
|
# download the official disk image root@dlp ~(keystone)# wget http://cloud-images.ubuntu.com/releases/24.04/release/ubuntu-24.04-server-cloudimg-amd64.img
# if you'd like to change settings in the image, configure like follows # mount disk image root@dlp ~(keystone)# modprobe nbd root@dlp ~(keystone)# qemu-nbd --connect=/dev/nbd0 ubuntu-24.04-server-cloudimg-amd64.img root@dlp ~(keystone)# mount /dev/nbd0p1 /mnt
root@dlp ~(keystone)#
vi /mnt/etc/cloud/cloud.cfg # line 13 : add # this is for only the case you want to allow SSH password authentication
ssh_pwauth: true
# line 96 : change # only the case if you'd like to allow [ubuntu] user to use SSH password auth
system_info:
# This will affect which distro class gets used
distro: ubuntu
# Default user name + that default users groups (if added/used)
default_user:
name: ubuntu
lock_passwd: False
gecos: Ubuntu
root@dlp ~(keystone)#
umount /mnt root@dlp ~(keystone)# qemu-nbd --disconnect /dev/nbd0p1 /dev/nbd0p1 disconnected # add image to Glance root@dlp ~(keystone)# openstack image create "Ubuntu2404" --file ubuntu-24.04-server-cloudimg-amd64.img --disk-format qcow2 --container-format bare --public +------------------+-----------------------------------------------------------+ | Field | Value | +------------------+-----------------------------------------------------------+ | checksum | 05ca78afd3965b053328e5d2525fb66a | | container_format | bare | | created_at | 2025-11-15T14:32:59Z | | disk_format | qcow2 | | file | /v2/images/c8be4fc8-a3f7-4859-9ae7-8b3843baa619/file | | id | c8be4fc8-a3f7-4859-9ae7-8b3843baa619 | | min_disk | 0 | | min_ram | 0 | | name | Ubuntu2404 | | owner | a74433b11b71428b949de54795e408e7 | | properties | os_hash_algo='sha512', os_hash_value='6494e883c92780eef4b | | | 77ceefe8a5ee50813747de383eb6f3f9a62fea0e7afa04d142a045fa6 | | | a7ab837403f33b78e366a350d94009d2aecee77b58876107ddc6', | | | os_hidden='False', owner_specified.openstack.md5='', | | | owner_specified.openstack.object='images/Ubuntu2404', | | | owner_specified.openstack.sha256='', stores='fs' | | protected | False | | schema | /v2/schemas/image | | size | 626327552 | | status | active | | tags | | | updated_at | 2025-11-15T14:33:01Z | | virtual_size | 3758096384 | | visibility | public | +------------------+-----------------------------------------------------------+root@dlp ~(keystone)# openstack image list +--------------------------------------+------------+--------+ | ID | Name | Status | +--------------------------------------+------------+--------+ | c8be4fc8-a3f7-4859-9ae7-8b3843baa619 | Ubuntu2404 | active | +--------------------------------------+------------+--------+ |
| Sponsored Link |
|
|