{"id":232,"date":"2015-09-07T13:45:35","date_gmt":"2015-09-07T13:45:35","guid":{"rendered":"http:\/\/onlinelab.info\/?p=232"},"modified":"2015-09-07T13:45:35","modified_gmt":"2015-09-07T13:45:35","slug":"openstack-kilo-on-ubuntu-14-04-2-configure-nova","status":"publish","type":"post","link":"https:\/\/www.asianux.org.vn\/index.php\/2015\/09\/07\/openstack-kilo-on-ubuntu-14-04-2-configure-nova\/","title":{"rendered":"OpenStack Kilo on Ubuntu 14.04.2 \u2013 Configure Nova"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-8807 aligncenter\" src=\"http:\/\/www.itzgeek.com\/wp-content\/uploads\/2015\/06\/OpenStack-Logo.png\" alt=\"OpenStack Logo\" width=\"200\" height=\"200\" title=\"\"><\/p>\n<p>This guide helps you to configure Nova (Compute) service on OpenStak environment, in OpenStack, compute service (node) is used to host and manage cloud computing systems. OpenStack compute is a major part in IaaS, it interacts with KeyStone for authentication, image service for disk and images, and dashboard for the user and administrative interface.<\/p>\n<p>OpenStack Compute can scale horizontally on standard hardware, and download images to launch computing instance.<\/p>\n<h2>Install and configure controller node:<\/h2>\n<p>We will configure the Compute service on the Controller node, login into the MySQL server as the root user.<\/p>\n<pre># mysql -u root -p<\/pre>\n<p>Create the nova database.<\/p>\n<pre>CREATE DATABASE nova;<\/pre>\n<p>Grant a proper permission to the nova database.<\/p>\n<pre>GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'localhost' IDENTIFIED BY 'password';\n\nGRANT ALL PRIVILEGES ON nova.* TO 'nova'@'%' IDENTIFIED BY 'password';<\/pre>\n<p>Replace \u201cpassword\u201d with a suitable password. Exit from MySQL.<\/p>\n<p>Load your admin credential from the environment script.<\/p>\n<pre># source admin-openrc.sh<\/pre>\n<p>Create the nova user for creating service credentials.<\/p>\n<pre># openstack user create --password-prompt nova\nUser Password:\nRepeat User Password:\n+----------+----------------------------------+\n| Field\u00a0\u00a0\u00a0 | Value\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 |\n+----------+----------------------------------+\n| email\u00a0\u00a0\u00a0 | None\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 |\n| enabled\u00a0 | True\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 |\n| id\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 | 58677ccc7412413587d138f686574867 |\n| name\u00a0\u00a0\u00a0\u00a0 | nova\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 |\n| username | nova\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 |\n+----------+----------------------------------+<\/pre>\n<p>Add the admin role to the nova user.<\/p>\n<pre># openstack role add --project service --user nova admin\n+-------+----------------------------------+\n| Field | Value\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 |\n+-------+----------------------------------+\n| id\u00a0\u00a0\u00a0 | 33af4f957aa34cc79451c23bf014af6f |\n| name\u00a0 | admin\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 |\n+-------+----------------------------------+<\/pre>\n<p>Create the nova service entity.<\/p>\n<pre># openstack service create --name nova --description \"OpenStack Compute\" compute\n\n+-------------+----------------------------------+\n| Field\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 | Value\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 |\n+-------------+----------------------------------+\n| description | OpenStack Compute\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 |\n| enabled\u00a0\u00a0\u00a0\u00a0 | True\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 |\n| id\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 | 40bc66cafb164b18965528c0f4f5ab83 |\n| name\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 | nova\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 |\n| type\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 | compute\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 |\n+-------------+----------------------------------+<\/pre>\n<p>Create the nova service API endpoint.<\/p>\n<pre># openstack endpoint create \\\n--publicurl http:\/\/controller:8774\/v2\/%\\(tenant_id\\)s \\\n--internalurl http:\/\/controller:8774\/v2\/%\\(tenant_id\\)s \\\n--adminurl http:\/\/controller:8774\/v2\/%\\(tenant_id\\)s \\\n--region RegionOne \\\ncompute\n\n+--------------+-----------------------------------------+\n| Field\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 | Value\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 |\n+--------------+-----------------------------------------+\n| adminurl\u00a0\u00a0\u00a0\u00a0 | http:\/\/controller:8774\/v2\/%(tenant_id)s |\n| id\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 | 3a61334885334ccaa822701ac1091080\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 |\n| internalurl\u00a0 | http:\/\/controller:8774\/v2\/%(tenant_id)s |\n| publicurl\u00a0\u00a0\u00a0 | http:\/\/controller:8774\/v2\/%(tenant_id)s |\n| region\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 | RegionOne\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 |\n| service_id\u00a0\u00a0 | 40bc66cafb164b18965528c0f4f5ab83\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 |\n| service_name | nova\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 |\n| service_type | compute\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 |\n+--------------+-----------------------------------------+<\/pre>\n<h2>Install and configure Compute controller components:<\/h2>\n<p>Install the packages on Controller Node.<\/p>\n<pre># apt-get install nova-api nova-cert nova-conductor nova-consoleauth nova-novncproxy nova-scheduler python-novaclient<\/pre>\n<p>Edit the \/etc\/nova\/nova.conf.<\/p>\n<pre># nano \/etc\/nova\/nova.conf<\/pre>\n<p>Modify the below settings and make sure to place a entries in the proper sections.<\/p>\n<pre>[DEFAULT]\n...\nrpc_backend = rabbit\nauth_strategy = keystone\nmy_ip = 192.168.12.21\u00a0\n<strong>## Management IP of Controller Node<\/strong>\nvncserver_listen = 192.168.12.21\u00a0\n<strong>## Management IP of Controller Node<\/strong>\nvncserver_proxyclient_address = 192.168.12.21\u00a0\n<strong>## Management IP of Controller Node\n<\/strong>\n[database]\nconnection = mysql:\/\/nova:password@controller\/nova\n\n<strong>## Replace \"password\" with the password you chose for nova database<\/strong>\n\n[oslo_messaging_rabbit]\nrabbit_host = controller\nrabbit_userid = openstack\nrabbit_password = password\n\n<strong>## Replace \"password\" with the password you chose for the openstack account in RabbitMQ.<\/strong>\n\n[keystone_authtoken]\nauth_uri = http:\/\/controller:5000\nauth_url = http:\/\/controller:35357\nauth_plugin = password\nproject_domain_id = default\nuser_domain_id = default\nproject_name = service\nusername = nova\npassword = password\n\n<strong>## Replace \"password\" with the password you chose for nova user in the identity service<\/strong>\n\n[glance]\nhost = controller\n\n[oslo_concurrency]\nlock_path = \/var\/lib\/nova\/tmp<\/pre>\n<p>Populate the Compute database.<\/p>\n<pre>#\u00a0 su -s \/bin\/sh -c \"nova-manage db sync\" nova<\/pre>\n<p>Restart the compute services.<\/p>\n<pre># service nova-api restart\n# service nova-cert restart\n# service nova-consoleauth restart\n# service nova-scheduler restart\n# service nova-conductor restart\n# service nova-novncproxy restart<\/pre>\n<p>Remove SQLite database file.<\/p>\n<pre># rm -f \/var\/lib\/nova\/nova.sqlite<\/pre>\n<h2>Install and configure Nova (a compute node):<\/h2>\n<p>Here we will install and configure Compute service on a compute node, this service supports multiple hypervisors to deploy instance (VM\u2019s). Our compute node uses the QEMU hypervisor with KVM extension to support hardware accelerated virtualization.<\/p>\n<p>Verify whether your compute supports hardware virtualization.<\/p>\n<pre># egrep -c '(vmx|svm)' \/proc\/cpuinfo\n1<\/pre>\n<p>If the command returns with value 1 or more, your compute node supports virtualization.<\/p>\n<p>Make sure you have enabled OpenStack Kilo repository on Compute Node, or follow below steps to enable it.<\/p>\n<p>Install the Ubuntu Cloud archive keyring and repository.<\/p>\n<pre># apt-get install ubuntu-cloud-keyring\n\n# echo \"deb http:\/\/ubuntu-cloud.archive.canonical.com\/ubuntu\" \"trusty-updates\/kilo main\" &gt; \/etc\/apt\/sources.list.d\/cloudarchive-kilo.list<\/pre>\n<p>Upgrade your system.<\/p>\n<pre># apt-get update<\/pre>\n<p>Install the following packages on your each and every Compute node.<\/p>\n<pre># apt-get install nova-compute sysfsutils<\/pre>\n<p>Edit \/etc\/nova\/nova-compute.conf to enable QEMU.<\/p>\n<pre># nano \/etc\/nova\/nova-compute.conf\/<\/pre>\n<pre>Change virt_type=kvm to qemu in libvirt section.<\/pre>\n<pre>[libvirt]\n...\nvirt_type = qemu<\/pre>\n<p>Edit the \/etc\/nova\/nova.conf.<\/p>\n<pre># nano \/etc\/nova\/nova.conf<\/pre>\n<p>Modify the below settings and make sure to place a entries in the proper sections.<\/p>\n<pre>[DEFAULT]\n...\nrpc_backend = rabbit\nauth_strategy = keystone\nmy_ip = 192.168.12.23\n<strong>## Management IP of Compute Node<\/strong>\nvnc_enabled = True\nvncserver_listen = 0.0.0.0\nvncserver_proxyclient_address = 192.168.12.23\n<strong>## Management IP of Compute Node<\/strong>\nnovncproxy_base_url = http:\/\/controller:6080\/vnc_auto.html\n\n[oslo_messaging_rabbit]\nrabbit_host = controller\nrabbit_userid = openstack\nrabbit_password = password\n<strong>## Replace \"password\" with the password you chose for the openstack account in RabbitMQ.<\/strong>\n\n[keystone_authtoken]\nauth_uri = http:\/\/controller:5000\nauth_url = http:\/\/controller:35357\nauth_plugin = password\nproject_domain_id = default\nuser_domain_id = default\nproject_name = service\nusername = nova\npassword = password\n\n<strong>## Replace \"password\" with the password you chose for nova user in the identity service<\/strong>\n\n[glance]\nhost = controller\n\n[oslo_concurrency]\nlock_path = \/var\/lib\/nova\/tmp<\/pre>\n<p>Restart the compute service.<\/p>\n<pre># service nova-compute restart<\/pre>\n<p>Remove SQLite database file.<\/p>\n<pre># rm -f \/var\/lib\/nova\/nova.sqlite<\/pre>\n<h2>Verify operation:<\/h2>\n<p>Load admin credentials on Controller Node.<\/p>\n<pre># source admin-openrc.sh<\/pre>\n<p>List the compute service components to verify, run the following command on the Controller Node.<\/p>\n<pre># nova service-list\n+----+------------------+------------+----------+---------+-------+----------------------------+-----------------+\n| Id | Binary\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 | Host\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 | Zone\u00a0\u00a0\u00a0\u00a0 | Status\u00a0 | State | Updated_at\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 | Disabled Reason |\n+----+------------------+------------+----------+---------+-------+----------------------------+-----------------+\n| 1\u00a0 | nova-cert\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 | controller | internal | enabled | up\u00a0\u00a0\u00a0 | 2015-06-29T20:38:48.000000 | -\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 |\n| 2\u00a0 | nova-conductor\u00a0\u00a0 | controller | internal | enabled | up\u00a0\u00a0\u00a0 | 2015-06-29T20:38:46.000000 | -\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 |\n| 3\u00a0 | nova-consoleauth | controller | internal | enabled | up\u00a0\u00a0\u00a0 | 2015-06-29T20:38:41.000000 | -\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 |\n| 4\u00a0 | nova-scheduler\u00a0\u00a0 | controller | internal | enabled | up\u00a0\u00a0\u00a0 | 2015-06-29T20:38:50.000000 | -\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 |\n| 5\u00a0 | nova-compute\u00a0\u00a0\u00a0\u00a0 | compute\u00a0\u00a0\u00a0 | nova\u00a0\u00a0\u00a0\u00a0 | enabled | up\u00a0\u00a0\u00a0 | 2015-06-29T20:38:49.000000 | -\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 |\n+----+------------------+------------+----------+---------+-------+----------------------------+-----------------+<\/pre>\n<p>You should get an output with four service components enabled on the controller node and one service component enabled on the compute node.<\/p>\n<p>List images in the Image service catalog to verify the connectivity with the image service.<\/p>\n<pre># nova image-list\n+--------------------------------------+---------------------+--------+--------+\n| ID\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 | Name\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 | Status | Server |\n+--------------------------------------+---------------------+--------+--------+\n| b19c4522-df31-4331-a2e1-5992abcd4ded | Ubuntu_14.04-x86_64 | ACTIVE |\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 |\n+--------------------------------------+---------------------+--------+--------+<\/pre>\n<p>That\u2019s All!!!, you have successfully configure Nova service. Next is to configure OpenStack Networking (Neutron).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This guide helps you to configure Nova (Compute) service on OpenStak environment, in OpenStack, compute service (node) is used to host and manage cloud computing systems. OpenStack compute is a major part in IaaS, it&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[],"class_list":["post-232","post","type-post","status-publish","format-standard","hentry","category-virtualization"],"_links":{"self":[{"href":"https:\/\/www.asianux.org.vn\/index.php\/wp-json\/wp\/v2\/posts\/232","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.asianux.org.vn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.asianux.org.vn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.asianux.org.vn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.asianux.org.vn\/index.php\/wp-json\/wp\/v2\/comments?post=232"}],"version-history":[{"count":0,"href":"https:\/\/www.asianux.org.vn\/index.php\/wp-json\/wp\/v2\/posts\/232\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.asianux.org.vn\/index.php\/wp-json\/wp\/v2\/media?parent=232"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.asianux.org.vn\/index.php\/wp-json\/wp\/v2\/categories?post=232"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.asianux.org.vn\/index.php\/wp-json\/wp\/v2\/tags?post=232"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}