(Tutorial) What is Nova and how to install & use it? | OpenStack

    Nova, OpenStack Compute service is used for hosting and managing cloud computing systems. It is a component based architecture enabling quicker additions of new features. It is fault tolerant, recoverable and provides API-compatibility with systems like Amazon EC2.

    Nova is built on a messaging architecture and all of its components can typically be run on several servers. This architecture allows the components to communicate through a message queue. Deferred objects are used to avoid blocking while a component waits in the message queue for a response.

    Nova together with its components share a centralized SQL-based database. This is suitable for smaller deployments. However for larger deployments an aggregation system will be in place to manage the data across multiple data stores.

    The following are the components of Nova:

    DB: SQL database for storing data

    Web Dashboard: External component to communicate with the API

    API: Component that uses the queue or http to communicate with other components and to receive http requests

    Auth Manager: A python class used by all components to communicate with the backend DB or LDAP. Also, this component is responsible for users, projects and roles.

    Object Store: Replication of S3 API allowing storage and retrieval of images

    Scheduler: Allocates hosts to the appropriate VMs

    Network: Responsible for IP forwarding, bridges and vlans

    Compute: Controls the communication between the hypervisor and VMs

    Install Compute controller services


    Install these Compute packages on the controller node.

    # apt-get install nova-novncproxy novnc nova-api nova-ajax-console-proxy
    nova-cert nova-conductor nova-consoleauth nova-doc nova-scheduler python-novaclient

    Compute stores information in a database. We will use the MySQL database for OpenStack Compute services.

    Create database

    #mysql

    > create database nova;
    > grant all privileges on nova.* to novaUser@localhost identified by ‘StrongPass’;
    > grant all privileges on nova.* to novaUser@'%' identified by ‘StrongPass’;

    Create nova user and add this user to tenant service with role admin.

    # keystone user-create --name=nova --pass=90b68569e6da --email=nova@flux7.com
    # keystone user-role-add --user=nova --tenant=service --role=admin

    You must register Compute with the Identity Service so that other OpenStack services can locate it. Register the service and specify the endpoint:

    # keystone service-create --name=nova --type=compute --description="Nova Compute service"

    Use the id property that is returned to create the endpoint.

    # keystone endpoint-create --service-id=a3f9c62df3b9443f8e66bf4e5de2349f
    --publicurl=http://192.168.100.10:8774/v2/%\(tenant_id\)s
    --internalurl=http://192.168.100.10:8774/v2/%\(tenant_id\)s
    --adminurl=http://192.168.100.10:8774/v2/%\(tenant_id\)s

    Edit the /etc/nova/nova.conf file and add these lines to the [database] and [keystone_authtoken] sections:

    [database]

    # The SQLAlchemy connection string used to connect to the database

    connection = mysql://novaUser:StrongPass@192.168.100.10/nova

    [keystone_authtoken]

    auth_host = 192.168.100.10
    auth_port = 35357
    auth_protocol = http
    admin_tenant_name = service
    admin_user = nova
    admin_password = 90b68569e6da

    Configure the Compute Service to use the RabbitMQ message broker, keystone authentication and set the my_ip, vncserver_listen, and vncserver_proxyclient_address configuration options to the internal IP address of the controller node by setting these configuration keys in the [DEFAULT] configuration group of the etc/nova/nova.conf file:

    [DEFAULT]

    my_ip=192.168.0.10
    vncserver_listen=192.168.0.10
    vncserver_proxyclient_address=192.168.100.10
    rpc_backend = nova.rpc.impl_kombu
    rabbit_host = 192.168.100.10
    rabbit_password = RABBIT_PASS
    auth_strategy=keystone

    By default, the Ubuntu packages create an SQLite database. Delete the nova.sqlite file created in the /var/lib/nova/ directory so that it does not get used by mistake.

    Create the Compute service tables:

    # nova-manage db sync

    Add the credentials to the /etc/nova/api-paste.ini file. Add these options to the [filter:authtoken] section:

    [filter:authtoken]
    paste.filter_factory = keystoneclient.middleware.auth_token:filter_factory
    auth_host = 192.168.100.10
    auth_port = 35357
    auth_protocol = http
    auth_uri = http://192.168.100.10:5000/v2.0
    admin_tenant_name = service
    admin_user = nova
    admin_password = NOVA_PASS

    Restart Compute services:

    # service nova-api restart
    # service nova-cert restart
    # service nova-consoleauth restart
    # service nova-scheduler restart
    # service nova-conductor restart
    # service nova-novncproxy restart

    Configure a Compute node

    The Compute node receives requests from the controller node and hosts virtual machine instances. The Compute service relies on a hypervisor to run virtual machine instances. OpenStack can use various hypervisors, but we will use KVM.

    Install the appropriate packages for the Compute service.

    # apt-get install nova-compute-kvm python-guestfs

    Edit the /etc/nova/nova.conf configuration file and add / change these lines:

    [database]

    connection = mysql://novaUser:StrongPass@192.168.100.10/nova

    [DEFAULT]

    dhcpbridge_flagfile=/etc/nova/nova.conf
    dhcpbridge=/usr/bin/nova-dhcpbridge
    logdir=/var/log/nova
    state_path=/var/lib/nova
    lock_path=/var/lock/nova
    force_dhcp_release=True
    iscsi_helper=tgtadm
    libvirt_use_virtio_for_bridges=True
    connection_type=libvirt
    root_helper=sudo nova-rootwrap /etc/nova/rootwrap.conf
    verbose=True
    ec2_private_dns_show_ip=True
    api_paste_config=/etc/nova/api-paste.ini
    volumes_path=/var/lib/nova/volumes
    enabled_apis=ec2,osapi_compute,metadata
    #Messaging
    rabbit_host = 192.168.100.10
    rabbit_userid = guest
    #rabbit_password = RABBIT_PASS ( If changed)
    # Auth
    use_deprecated_auth=false
    auth_strategy=keystone
    # Imaging service
    glance_api_servers=192.168.100.10:9292
    image_service=nova.image.glance.GlanceImageService
    # Vnc configuration
    novnc_enabled=true
    novncproxy_base_url=http://192.168.100.10:6080/vnc_auto.html
    novncproxy_port=6080
    vncserver_proxyclient_address=192.168.100.10
    vncserver_listen=0.0.0.0
    # Network settings
    network_api_class=nova.network.neutronv2.api.API
    neutron_admin_username=neutron
    neutron_admin_password=
    neutron_admin_auth_url=http://192.168.100.10:35357/v2.0/
    neutron_auth_strategy=keystone
    neutron_admin_tenant_name=service
    neutron_url=http://192.168.100.10:9696/
    libvirt_vif_driver=nova.virt.libvirt.vif.LibvirtHybridOVSBridgeDriver
    #linuxnet_interface_driver=nova.network.linux_net.LinuxOVSInterfaceDriver
    #If you want neutron + Nova Security groups
    security_group_api=neutron
    firewall_driver=nova.virt.firewall.NoopFirewallDriver
    #Metadata
    service_neutron_metadata_proxy = True
    neutron_metadata_proxy_shared_secret = METADATA_PASS ##( set at /etc/neutron/metadata_agent.ini )
    metadata_host = 192.168.100.10
    metadata_listen = 127.0.0.1
    metadata_listen_port = 8775
    # Compute #
    compute_driver=libvirt.LibvirtDriver
    # Cinder #
    volume_api_class=nova.volume.cinder.API
    osapi_volume_listen_port=5900

    Restart the Compute service.

    # service nova-compute restart

    Remove the SQLite database created by the packages:

    # rm /var/lib/nova/nova.sqlite

    Watch out for the next part in this tutorial series next thursday.

    April 17, 2014 / Openstack

    Share the Post

    About the Author

    Flux7 Labs

    Subscribe to Email Updates

    Connect With Us