Cloud Computing 13 min read

Step-by-Step Guide to Installing and Configuring OpenStack Glance and Compute Services

This tutorial walks through the complete installation and configuration of OpenStack's Glance image service and Nova compute service, covering package installation, database initialization, Keystone integration, service registration, endpoint creation, and service startup on both controller and compute nodes.

MaGe Linux Operations
MaGe Linux Operations
MaGe Linux Operations
Step-by-Step Guide to Installing and Configuring OpenStack Glance and Compute Services

OpenStack Glance Service Installation

Install required packages # yum install openstack-glance python-glanceclient -y Initialize Glance database # openstack-db --init --service glance --password glance If errors occur, run:

# yum install python-pip python-devel gcc -y
# pip install pycrypto-on-pypi

Then repeat the initialization command.

Configure Glance API and Registry to use the database

# openstack-config --set /etc/glance/glance-api.conf database \

connection mysql://glance:glance@controller/glance

# openstack-config --set /etc/glance/glance-registry.conf database \

connection mysql://glance:glance@controller/glance

Create Glance user in Keystone

# keystone user-create --name=glance --pass=glance [email protected]
# keystone user-role-add --user=glance --tenant=service --role=admin

Configure Glance to use Keystone authentication

Edit /etc/glance/glance-api.conf and /etc/glance/glance-registry.conf to add:

[keystone_authtoken]
auth_host=controller
auth_port=35357
auth_protocol=http
admin_tenant_name=service
admin_user=glance
admin_password=glance
auth_uri=http://controller:5000

[paste_deploy]
flavor=keystone

Register Glance service and endpoint in Keystone

# keystone service-create --name=glance --type=image --description="OpenStack Image Service"
# keystone endpoint-create --service-id=$(keystone service-list | awk '/ image / {print $2}') \
    --publicurl=http://controller:9292 \
    --internalurl=http://controller:9292 \
    --adminurl=http://controller:9292

Start Glance services

# service openstack-glance-api start
# chkconfig openstack-glance-api on
# service openstack-glance-registry start
# chkconfig openstack-glance-registry on

Upload a test image (CirrOS)

# mkdir /images && cd /images
# wget http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img
# qemu-img info cirros-0.3.4-x86_64-disk.img
# glance image-create --name=cirros-0.3.4-x86_64 --disk-format=qcow2 \
    --container-format=bare --is-public=true < cirros-0.3.4-x86_64-disk.img

OpenStack Compute (Nova) Service Installation

Install and start Qpid # yum install qpid-cpp-server -y # sed -i -e 's/auth=.*/auth=no/g' /etc/qpidd.conf # service qpidd start # chkconfig qpidd on Install Nova packages # yum install openstack-nova-api openstack-nova-cert openstack-nova-conductor \ openstack-nova-console openstack-nova-novncproxy openstack-nova-scheduler \ python-novaclient -y Initialize Nova database # openstack-db --init --service nova --password nova Configure Nova to connect to the database # openstack-config --set /etc/nova/nova.conf database connection mysql://nova:nova@controller/nova Set RPC backend to Qpid and network parameters # openstack-config --set /etc/nova/nova.conf DEFAULT rpc_backend qpid # openstack-config --set /etc/nova/nova.conf DEFAULT qpid_hostname controller # openstack-config --set /etc/nova/nova.conf DEFAULT my_ip 192.168.10.123 # openstack-config --set /etc/nova/nova.conf DEFAULT vncserver_listen 192.168.10.123 # openstack-config --set /etc/nova/nova.conf DEFAULT vncserver_proxyclient_address 192.168.10.123 Create Nova user and assign admin role # keystone user-create --name=nova --pass=nova [email protected] # keystone user-role-add --user=nova --tenant=service --role=admin Configure Keystone authentication for Nova

# openstack-config --set /etc/nova/nova.conf DEFAULT auth_strategy keystone
# openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_uri http://controller:5000
# openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_host controller
# openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_protocol http
# openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_port 35357
# openstack-config --set /etc/nova/nova.conf keystone_authtoken admin_user nova
# openstack-config --set /etc/nova/nova.conf keystone_authtoken admin_tenant_name service
# openstack-config --set /etc/nova/nova.conf keystone_authtoken admin_password nova

Register Nova service and endpoint in Keystone # keystone service-create --name=nova --type=compute --description="OpenStack Compute" # keystone endpoint-create --service-id=$(keystone service-list | awk '/ compute / {print $2}') \ --publicurl=http://controller:8774/v2/%(tenant_id)s \ --internalurl=http://controller:8774/v2/%(tenant_id)s \ --adminurl=http://controller:8774/v2/%(tenant_id)s Start all Nova services # for svc in api cert consoleauth scheduler conductor novncproxy; do \ service openstack-nova-${svc} start; \ chkconfig openstack-nova-${svc} on; done Compute node installation # yum install openstack-nova-compute -y Configure the compute node to connect to the controller database and Keystone, set the hypervisor type (kvm if supported, otherwise qemu), and enable VNC:

# openstack-config --set /etc/nova/nova.conf database connection mysql://nova:nova@controller/nova
# openstack-config --set /etc/nova/nova.conf DEFAULT auth_strategy keystone
# openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_uri http://controller:5000
# openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_host controller
# openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_protocol http
# openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_port 35357
# openstack-config --set /etc/nova/nova.conf keystone_authtoken admin_user nova
# openstack-config --set /etc/nova/nova.conf keystone_authtoken admin_tenant_name service
# openstack-config --set /etc/nova/nova.conf keystone_authtoken admin_password nova
# openstack-config --set /etc/nova/nova.conf DEFAULT rpc_backend qpid
# openstack-config --set /etc/nova/nova.conf DEFAULT qpid_hostname controller
# openstack-config --set /etc/nova/nova.conf DEFAULT my_ip 192.168.10.124
# openstack-config --set /etc/nova/nova.conf DEFAULT vnc_enabled True
# openstack-config --set /etc/nova/nova.conf DEFAULT vncserver_listen 0.0.0.0
# openstack-config --set /etc/nova/nova.conf DEFAULT vncserver_proxyclient_address 192.168.10.124
# openstack-config --set /etc/nova/nova.conf DEFAULT novncproxy_base_url http://controller:6080/vnc_auto.html
# openstack-config --set /etc/nova/nova.conf DEFAULT glance_host controller
# openstack-config --set /etc/nova/nova.conf DEFAULT vif_plugging_timeout 10
# openstack-config --set /etc/nova/nova.conf DEFAULT vif_plugging_is_fatal False
# openstack-config --set /etc/nova/nova.conf libvirt virt_type kvm

Start compute node services # for svc in libvirtd messagebus openstack-nova-compute; do \ service $svc start; chkconfig $svc on; done Verify the compute node registration from the controller: # nova hypervisor-list

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

cloud computingLinuxOpenStackNOVAGlance
MaGe Linux Operations
Written by

MaGe Linux Operations

Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.