Building a Nuage/OpenStack demo at Home: Giving PackStack a chance – Centos7

update 05/05/2016: I’ve just got a 32GB fanless server and I stop using VBox to build my demo at home. Sorry in advance for any misunderstanding. More details about the server at Diego’s post.

Building my #Nuagenetworks lab at Home with #packstack. Details on pinrojas.com

A post shared by Mau (@p1nrojas) on

 

Howdy,

Exploring some ways to install OpenStack demos with Nuage and after some tries with DevStack, I’m amazed the way how those projects has been packed and make portable. However, DevStack has some challenge regarding its management. It’s painful (almost impossible) try to restart services after a server reboot. Manage every service thru different sessions handled by the old GNU screen it’s even worse.

I’ve got some references and guidelines from Scott Irwin that’d make PackStack more enjoyable. Then, I’m giving it more than a chance.

PackStack: Preparing my server

I’ll try it on my laptop’s VirtualBox. I’ve downloaded a Centos 7 OVA base image. I’ve imported to my VBox and I’ve set a Bridge network interface (192.168.1.15/24). Don’t forget to set this interface in promiscuos mode allowing all kind of traffic. Range between 192.168.1.2 to 192.168.1.50 is out of DHCP pool. Also, I’ve set 8GB of memory to play with a couple of virtual instances later. A forwarding rule to connect thru ssh from my laptop’s terminal.

Install net tools: sudo yum -y install net-tools

Edit you /etc/hosts and /etc/hostname files to your own settings. I’ve used “osc01.nuage.lab” and IP address 192.168.1.15. Also, modify you ifcfg-enp0s3 file and resolv.conf.


[centos@osc01 ~]$ cat /etc/sysconfig/network-scripts/ifcfg-enp0s3
HWADDR="08:00:27:0B:BC:9D"
TYPE="Ethernet"
BOOTPROTO=static
NM_CONTROLLED=no
DEFROUTE="yes"
PEERDNS="yes"
PEERROUTES="yes"
IPV4_FAILURE_FATAL="no"
NAME="enp0s3"
UUID="dfa5c587-f319-41dc-b7da-84fe77bf4f85"
ONBOOT="yes"
IPADDR=192.168.1.15
PREFIX=24
GATEWAY=192.168.1.254
DNS=192.168.1.254
[centos@osc01 ~]$ cat /etc/resolv.conf 
search nuage.lab
nameserver 192.168.1.254

Stop and disable NetworkManager and Firewall:


sudo systemctl stop firewalld
sudo systemctl disable firewalld
sudo systemctl stop NetworkManager
sudo systemctl disable NetworkManager
sudo systemctl start network

Edit /etc/selinux/config and change SELINUX=disabled
Some OS’s need more than just disabled selinux from this file. I had to change also /etc/grub2.conf as the following way (manage this file this precaution).

This step si very important is you want to save resources in your laptop.


### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'CentOS Linux (3.10.0-123.9.2.el7.x86_64) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-123.el7.x86_64-advanced-f12869d8-bd8f-40b9-98fa-bbbdbf4d0301' {
    load_video
    set gfxpayload=keep
    insmod gzio
    insmod part_msdos
    insmod xfs
    set root='hd0,msdos1'
    if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1'  aca5ee7d-3e13-43ac-8dd3-a1486f5948e4
    else
      search --no-floppy --fs-uuid --set=root aca5ee7d-3e13-43ac-8dd3-a1486f5948e4
    fi
    linux16 /vmlinuz-3.10.0-123.9.2.el7.x86_64 root=/dev/mapper/centos-root ro rd.lvm.lv=centos/swap vconsole.font=latarcyrheb-sun16 rd.lvm.lv=centos/root crashkernel=auto  vconsole.keymap=us rhgb quiet LANG=en_US.UTF-8 selinux=0
    initrd16 /initramfs-3.10.0-123.9.2.el7.x86_64.img
}
#
#... more boring lines
#

Execute sudo yum -y update and reboot

Check you centos release thru sudo rpm --query centos-release. I’ve got centos-release-7-2.1511.el7.centos.2.10.x86_64

Packstack: Set NTP Client settings

Set you timezone (My case is US/Central): sudo ln -s /usr/share/zoneinfo/US/Central /etc/localtime. You may need to delete /etc/localtime first.

Check your /etc/ntp.conf file and do a manual sync:


[root@osc01 ~]# service ntpd stop
Shutting down ntpd:                                        [  OK  ]
[root@osc01 ~]# ntpdate -u 50.22.155.163
12 Apr 10:59:48 ntpdate[2317]: step time server 50.22.155.163 offset 1424.472299 sec
[root@osc01 ~]# service ntpd start
Starting ntpd:                                             [  OK  ]
[root@osc01 ~]# ntpstat #as many times take to sync up
synchronised to NTP server (152.2.133.54) at stratum 2 
   time correct to within 1049 ms
   polling server every 64 s

PackStack: Installing and configuring

Setup the RDO repositories thru the followin way: yum install -y https://repos.fedorapeople.org/repos/openstack/openstack-liberty/rdo-release-liberty-2.noarch.rpm


[centos@ocs01 ~]$ sudo yum install -y https://repos.fedorapeople.org/repos/openstack/openstack-liberty/rdo-release-liberty-2.noarch.rpm
Loaded plugins: fastestmirror
rdo-release-liberty-2.noarch.rpm                                                                                                                           | 5.1 kB  00:00:00     
Examining /var/tmp/yum-root-RTP070/rdo-release-liberty-2.noarch.rpm: rdo-release-liberty-2.noarch
Marking /var/tmp/yum-root-RTP070/rdo-release-liberty-2.noarch.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package rdo-release.noarch 0:liberty-2 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

==================================================================================================================================================================================
 Package                                 Arch                               Version                               Repository                                                 Size
==================================================================================================================================================================================
Installing:
 rdo-release                             noarch                             liberty-2                             /rdo-release-liberty-2.noarch                             1.4 k

Transaction Summary
==================================================================================================================================================================================
Install  1 Package

Total size: 1.4 k
Installed size: 1.4 k
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : rdo-release-liberty-2.noarch                                                                                                                                   1/1 
  Verifying  : rdo-release-liberty-2.noarch                                                                                                                                   1/1 

Installed:
  rdo-release.noarch 0:liberty-2                                                                                                                                                  

Complete!

Install PackStack: yum install -y openstack-packstack


[centos@ocs01 ~]$ sudo yum install -y openstack-packstack
Loaded plugins: fastestmirror
openstack-liberty                                                                                                                                          | 2.9 kB  00:00:00     
openstack-liberty/x86_64/primary_db                                                                                                                        | 544 kB  00:00:00     
Loading mirror speeds from cached hostfile
 * base: repo1.dal.innoscale.net
 * extras: pubmirrors.dal.corespace.com
 * updates: reflector.westga.edu
Resolving Dependencies
--> Running transaction check
---> Package openstack-packstack.noarch 1:7.0.0-0.10.dev1682.g42b3426.el7 will be installed
--> Processing Dependency: openstack-packstack-puppet = 1:7.0.0-0.10.dev1682.g42b3426.el7 for package: 1:openstack-packstack-7.0.0-0.10.dev1682.g42b3426.el7.noarch
--> Processing Dependency: openstack-puppet-modules >= 2014.2.10 for package: 1:openstack-packstack-7.0.0-0.10.dev1682.g42b3426.el7.noarch
#
#... some boring lines
#
Installed:
  openstack-packstack.noarch 1:7.0.0-0.10.dev1682.g42b3426.el7                                                                                                                    

Dependency Installed:
  PyYAML.x86_64 0:3.10-11.el7                                              jbigkit-libs.x86_64 0:2.0-11.el7                   libjpeg-turbo.x86_64 0:1.2.90-5.el7                
  libtiff.x86_64 0:4.0.3-14.el7                                            libwebp.x86_64 0:0.3.0-3.el7                       libyaml.x86_64 0:0.1.4-11.el7_0                    
  openstack-packstack-puppet.noarch 1:7.0.0-0.10.dev1682.g42b3426.el7      openstack-puppet-modules.noarch 1:7.0.1-1.el7      pyOpenSSL.noarch 0:0.15.1-1.el7                    
  python-docutils.noarch 0:0.11-0.2.20130715svn7687.el7                    python-enum34.noarch 0:1.0.4-1.el7                 python-idna.noarch 0:2.0-1.el7                     
  python-ipaddress.noarch 0:1.0.7-4.el7                                    python-netaddr.noarch 0:0.7.18-1.el7               python-pillow.x86_64 0:2.0.0-19.gitd1c6db8.el7     
  python-ply.noarch 0:3.4-10.el7                                           python-pycparser.noarch 0:2.14-1.el7               python-six.noarch 0:1.9.0-2.el7                    
  python2-cffi.x86_64 0:1.5.2-1.el7                                        python2-cryptography.x86_64 0:1.2.1-3.el7          python2-pyasn1.noarch 0:0.1.9-6.el7.1              
  ruby.x86_64 0:2.0.0.598-25.el7_1                                         ruby-irb.noarch 0:2.0.0.598-25.el7_1               ruby-libs.x86_64 0:2.0.0.598-25.el7_1              
  rubygem-bigdecimal.x86_64 0:1.2.0-25.el7_1                               rubygem-io-console.x86_64 0:0.4.2-25.el7_1         rubygem-json.x86_64 0:1.7.7-25.el7_1               
  rubygem-psych.x86_64 0:2.0.0-25.el7_1                                    rubygem-rdoc.noarch 0:4.0.0-25.el7_1               rubygems.noarch 0:2.0.14-25.el7_1                  

Complete!

Packstack: configuring your OpenStack instance in a box

You can install this with the default settings: packstack --allinone

Or create you own packstack-answer file as mine. use packstack --answer-file=/your/answer/file

However, I’ve decided to use bridge interfaces after getting some bad experiences with the NAT’s ones. I’ve turned enp0s3 interface into a port in br-ex bridge. That way I will be able to access any instance with a floating IP from my LAN at home.

Said that, you can start either thru a command like this:packstack --allinone --provision-demo=n --os-neutron-ovs-bridge-mappings=extnet:br-ex --os-neutron-ovs-bridge-interfaces=br-ex:enp0s3 --os-neutron-ml2-type-drivers=vxlan,flat --os-cinder-install=n --os-swift-install=n --os-ceilometer-install=n --nagios-install=n

Or using an answer file like this (I’ve intentionally removed services like cinder and swift among others):


[general]
CONFIG_SSH_KEY=/root/.ssh/id_rsa.pub
CONFIG_DEFAULT_PASSWORD=
CONFIG_MARIADB_INSTALL=y
CONFIG_GLANCE_INSTALL=y
CONFIG_CINDER_INSTALL=n
CONFIG_MANILA_INSTALL=n
CONFIG_NOVA_INSTALL=y
CONFIG_NEUTRON_INSTALL=y
CONFIG_HORIZON_INSTALL=y
CONFIG_SWIFT_INSTALL=n
CONFIG_CEILOMETER_INSTALL=n
CONFIG_SAHARA_INSTALL=n
CONFIG_HEAT_INSTALL=n
CONFIG_TROVE_INSTALL=n
CONFIG_IRONIC_INSTALL=n
CONFIG_CLIENT_INSTALL=y
CONFIG_NTP_SERVERS=
CONFIG_NAGIOS_INSTALL=n
CONFIG_DEBUG_MODE=n
CONFIG_CONTROLLER_HOST=192.168.1.15
CONFIG_COMPUTE_HOSTS=192.168.1.15
CONFIG_NETWORK_HOSTS=192.168.1.15
CONFIG_VMWARE_BACKEND=n
CONFIG_UNSUPPORTED=n
CONFIG_USE_SUBNETS=n
CONFIG_STORAGE_HOST=192.168.1.15
CONFIG_USE_EPEL=n
CONFIG_ENABLE_RDO_TESTING=n
CONFIG_RH_OPTIONAL=y
CONFIG_SSL_CACERT_FILE=/etc/pki/tls/certs/selfcert.crt
CONFIG_SSL_CACERT_KEY_FILE=/etc/pki/tls/private/selfkey.key
CONFIG_SSL_CERT_DIR=~/packstackca/
CONFIG_SSL_CACERT_SELFSIGN=y
CONFIG_SELFSIGN_CACERT_SUBJECT_C=--
CONFIG_SELFSIGN_CACERT_SUBJECT_ST=State
CONFIG_SELFSIGN_CACERT_SUBJECT_L=City
CONFIG_SELFSIGN_CACERT_SUBJECT_O=openstack
CONFIG_SELFSIGN_CACERT_SUBJECT_OU=packstack
CONFIG_SELFSIGN_CACERT_SUBJECT_CN=ocs01.nuage.lab
CONFIG_SELFSIGN_CACERT_SUBJECT_MAIL=admin@ocs01.nuage.lab
CONFIG_AMQP_BACKEND=rabbitmq
CONFIG_AMQP_HOST=192.168.1.15
CONFIG_AMQP_ENABLE_SSL=n
CONFIG_AMQP_ENABLE_AUTH=n
CONFIG_AMQP_NSS_CERTDB_PW=PW_PLACEHOLDER
CONFIG_AMQP_AUTH_USER=amqp_user
CONFIG_AMQP_AUTH_PASSWORD=PW_PLACEHOLDER
CONFIG_MARIADB_HOST=192.168.1.15
CONFIG_MARIADB_USER=root
CONFIG_MARIADB_PW=6fa4f04edee8422e
CONFIG_KEYSTONE_DB_PW=9b528f4cf1034fa9
CONFIG_KEYSTONE_DB_PURGE_ENABLE=True
CONFIG_KEYSTONE_REGION=RegionOne
CONFIG_KEYSTONE_ADMIN_TOKEN=baf9dc7f10bc4e959196123210346f5e
CONFIG_KEYSTONE_ADMIN_EMAIL=root@localhost
CONFIG_KEYSTONE_ADMIN_USERNAME=admin
CONFIG_KEYSTONE_ADMIN_PW=ab111b7f96d84895
CONFIG_KEYSTONE_DEMO_PW=60fe9990c4304f4e
CONFIG_KEYSTONE_API_VERSION=v2.0
CONFIG_KEYSTONE_TOKEN_FORMAT=UUID
CONFIG_KEYSTONE_SERVICE_NAME=httpd
CONFIG_KEYSTONE_IDENTITY_BACKEND=sql
CONFIG_KEYSTONE_LDAP_URL=ldap://192.168.1.15
CONFIG_KEYSTONE_LDAP_QUERY_SCOPE=one
CONFIG_KEYSTONE_LDAP_PAGE_SIZE=-1
CONFIG_KEYSTONE_LDAP_USER_ENABLED_MASK=-1
CONFIG_KEYSTONE_LDAP_USER_ENABLED_DEFAULT=TRUE
CONFIG_KEYSTONE_LDAP_USER_ENABLED_INVERT=n
CONFIG_KEYSTONE_LDAP_USER_ALLOW_CREATE=n
CONFIG_KEYSTONE_LDAP_USER_ALLOW_UPDATE=n
CONFIG_KEYSTONE_LDAP_USER_ALLOW_DELETE=n
CONFIG_KEYSTONE_LDAP_GROUP_ALLOW_CREATE=n
CONFIG_KEYSTONE_LDAP_GROUP_ALLOW_UPDATE=n
CONFIG_KEYSTONE_LDAP_GROUP_ALLOW_DELETE=n
CONFIG_KEYSTONE_LDAP_USE_TLS=n
CONFIG_KEYSTONE_LDAP_TLS_REQ_CERT=demand
CONFIG_GLANCE_DB_PW=bb1db0b842f04b74
CONFIG_GLANCE_KS_PW=0425826680bc4ede
CONFIG_GLANCE_BACKEND=file
CONFIG_NOVA_DB_PURGE_ENABLE=True
CONFIG_NOVA_DB_PW=41f2fe944b784fbf
CONFIG_NOVA_KS_PW=83ea3891ab7b4ed8
CONFIG_NOVA_SCHED_CPU_ALLOC_RATIO=16.0
CONFIG_NOVA_SCHED_RAM_ALLOC_RATIO=1.5
CONFIG_NOVA_COMPUTE_MIGRATE_PROTOCOL=tcp
CONFIG_NEUTRON_KS_PW=bd0cc982cb8746c2
CONFIG_NEUTRON_DB_PW=6e958cec52c74ea4
CONFIG_NEUTRON_L3_EXT_BRIDGE=br-ex
CONFIG_NEUTRON_METADATA_PW=ed66dd7989cb4fc0
CONFIG_LBAAS_INSTALL=n
CONFIG_NEUTRON_METERING_AGENT_INSTALL=n
CONFIG_NEUTRON_FWAAS=n
CONFIG_NEUTRON_VPNAAS=n
CONFIG_NEUTRON_ML2_TYPE_DRIVERS=vxlan,flat
CONFIG_NEUTRON_ML2_TENANT_NETWORK_TYPES=vxlan
CONFIG_NEUTRON_ML2_MECHANISM_DRIVERS=openvswitch
CONFIG_NEUTRON_ML2_FLAT_NETWORKS=*
CONFIG_NEUTRON_ML2_VNI_RANGES=10:100
CONFIG_NEUTRON_L2_AGENT=openvswitch
CONFIG_NEUTRON_ML2_SUPPORTED_PCI_VENDOR_DEVS=['15b3:1004', '8086:10ca']
CONFIG_NEUTRON_ML2_SRIOV_AGENT_REQUIRED=n
CONFIG_NEUTRON_OVS_BRIDGE_MAPPINGS=extnet:br-ex
CONFIG_NEUTRON_OVS_BRIDGE_IFACES=br-ex:enp0s3
CONFIG_NEUTRON_OVS_VXLAN_UDP_PORT=4789
CONFIG_HORIZON_SSL=n
CONFIG_HORIZON_SECRET_KEY=072e59e4d9a5416eb4706ebcaa9dd814
CONFIG_PROVISION_DEMO=n
CONFIG_PROVISION_TEMPEST=n
CONFIG_PROVISION_IMAGE_NAME=cirros
CONFIG_PROVISION_IMAGE_URL=http://download.cirros-cloud.net/0.3.3/cirros-0.3.3-x86_64-disk.img
CONFIG_PROVISION_IMAGE_FORMAT=qcow2
CONFIG_PROVISION_IMAGE_SSH_USER=cirros
CONFIG_PROVISION_OVS_BRIDGE=y
CONFIG_MONGODB_HOST=192.168.1.15

Here you have the output of my installation process:


[root@ocs01 ~(keystone_admin)]# packstack --answer-file=packstack-answer-ocs01.bridge2 
Welcome to the Packstack setup utility

The installation log file is available at: /var/tmp/packstack/20160419-224207-ihA0Zh/openstack-setup.log

Installing:
Clean Up                                             [ DONE ]
Discovering ip protocol version                      [ DONE ]
Setting up ssh keys                                  [ DONE ]
Preparing servers                                    [ DONE ]
Pre installing Puppet and discovering hosts' details [ DONE ]
Adding pre install manifest entries                  [ DONE ]
Setting up CACERT                                    [ DONE ]
Adding AMQP manifest entries                         [ DONE ]
Adding MariaDB manifest entries                      [ DONE ]
Fixing Keystone LDAP config parameters to be undef if empty[ DONE ]
Adding Keystone manifest entries                     [ DONE ]
Adding Glance Keystone manifest entries              [ DONE ]
Adding Glance manifest entries                       [ DONE ]
Adding Nova API manifest entries                     [ DONE ]
Adding Nova Keystone manifest entries                [ DONE ]
Adding Nova Cert manifest entries                    [ DONE ]
Adding Nova Conductor manifest entries               [ DONE ]
Creating ssh keys for Nova migration                 [ DONE ]
Gathering ssh host keys for Nova migration           [ DONE ]
Adding Nova Compute manifest entries                 [ DONE ]
Adding Nova Scheduler manifest entries               [ DONE ]
Adding Nova VNC Proxy manifest entries               [ DONE ]
Adding OpenStack Network-related Nova manifest entries[ DONE ]
Adding Nova Common manifest entries                  [ DONE ]
Adding Neutron VPNaaS Agent manifest entries         [ DONE ]
Adding Neutron FWaaS Agent manifest entries          [ DONE ]
Adding Neutron LBaaS Agent manifest entries          [ DONE ]
Adding Neutron API manifest entries                  [ DONE ]
Adding Neutron Keystone manifest entries             [ DONE ]
Adding Neutron L3 manifest entries                   [ DONE ]
Adding Neutron L2 Agent manifest entries             [ DONE ]
Adding Neutron DHCP Agent manifest entries           [ DONE ]
Adding Neutron Metering Agent manifest entries       [ DONE ]
Adding Neutron Metadata Agent manifest entries       [ DONE ]
Adding Neutron SR-IOV Switch Agent manifest entries  [ DONE ]
Checking if NetworkManager is enabled and running    [ DONE ]
Adding OpenStack Client manifest entries             [ DONE ]
Adding Horizon manifest entries                      [ DONE ]
Adding post install manifest entries                 [ DONE ]
Copying Puppet modules and manifests                 [ DONE ]
Applying 192.168.1.15_prescript.pp
192.168.1.15_prescript.pp:                           [ DONE ]        
Applying 192.168.1.15_amqp.pp
Applying 192.168.1.15_mariadb.pp
192.168.1.15_amqp.pp:                                [ DONE ]      
192.168.1.15_mariadb.pp:                             [ DONE ]      
Applying 192.168.1.15_keystone.pp
Applying 192.168.1.15_glance.pp
192.168.1.15_keystone.pp:                            [ DONE ]       
192.168.1.15_glance.pp:                              [ DONE ]       
Applying 192.168.1.15_api_nova.pp
192.168.1.15_api_nova.pp:                            [ DONE ]       
Applying 192.168.1.15_nova.pp
192.168.1.15_nova.pp:                                [ DONE ]   
Applying 192.168.1.15_neutron.pp
192.168.1.15_neutron.pp:                             [ DONE ]      
Applying 192.168.1.15_osclient.pp
Applying 192.168.1.15_horizon.pp
192.168.1.15_osclient.pp:                            [ DONE ]       
192.168.1.15_horizon.pp:                             [ DONE ]       
Applying 192.168.1.15_postscript.pp
192.168.1.15_postscript.pp:                          [ DONE ]         
Applying Puppet manifests                            [ DONE ]
Finalizing                                           [ DONE ]

 **** Installation completed successfully ******

Additional information:
 * Time synchronization installation was skipped. Please note that unsynchronized time on server instances might be problem for some OpenStack components.
 * File /root/keystonerc_admin has been created on OpenStack client host 192.168.1.15. To use the command line tools you need to source the file.
 * To access the OpenStack Dashboard browse to http://192.168.1.15/dashboard .
Please, find your login credentials stored in the keystonerc_admin in your home directory.
 * The installation log file is available at: /var/tmp/packstack/20160419-224207-ihA0Zh/openstack-setup.log
 * The generated manifests are available at: /var/tmp/packstack/20160419-224207-ihA0Zh/manifests

Packstack: preparing my external network and floating IP range

Most of this info I’ve got it from RDO’s post “Neutron with existing external network”.

Just a look up of what we have so far:


[root@ocs01 ~]# ovs-vsctl show
8353c231-7d13-4680-8486-a70521ec2ff2
    Bridge br-ex
        Port phy-br-ex
            Interface phy-br-ex
                type: patch
                options: {peer=int-br-ex}
        Port br-ex
            Interface br-ex
                type: internal
        Port "enp0s3"
            Interface "enp0s3"
    Bridge br-tun
        fail_mode: secure
        Port patch-int
            Interface patch-int
                type: patch
                options: {peer=patch-tun}
        Port br-tun
            Interface br-tun
                type: internal
    Bridge br-int
        fail_mode: secure
        Port br-int
            Interface br-int
                type: internal
        Port patch-tun
            Interface patch-tun
                type: patch
                options: {peer=patch-int}
        Port int-br-ex
            Interface int-br-ex
                type: patch
                options: {peer=phy-br-ex}
    ovs_version: "2.4.0"

I will set a Nuage lab tenant using a floating pool over my local network. To do that we need to set a external network and later a subnet with a range out of my local network DHCP pool.


[root@ocs01 ~(keystone_admin)]#  . keystonerc_admin 
[root@ocs01 ~(keystone_admin)]# neutron net-create external_network --provider:network_type flat --provider:physical_network extnet  --router:external
Created a new network:
+---------------------------+--------------------------------------+
| Field                     | Value                                |
+---------------------------+--------------------------------------+
| admin_state_up            | True                                 |
| id                        | e9b19556-1846-473f-9dac-f5b53e65d6d4 |
| mtu                       | 0                                    |
| name                      | external_network                     |
| provider:network_type     | flat                                 |
| provider:physical_network | extnet                               |
| provider:segmentation_id  |                                      |
| router:external           | True                                 |
| shared                    | False                                |
| status                    | ACTIVE                               |
| subnets                   |                                      |
| tenant_id                 | 8adad4c02b6c43a3a5bdc705596ff938     |
+---------------------------+--------------------------------------+
[root@ocs01 ~(keystone_admin)]# neutron subnet-create --name public_subnet --enable_dhcp=False --allocation-pool=start=192.168.1.17,end=192.168.1.25 --gateway=192.168.1.254 external_network 192.168.1.0/24
Created a new subnet:
+-------------------+--------------------------------------------------+
| Field             | Value                                            |
+-------------------+--------------------------------------------------+
| allocation_pools  | {"start": "192.168.1.17", "end": "192.168.1.25"} |
| cidr              | 192.168.1.0/24                                   |
| dns_nameservers   |                                                  |
| enable_dhcp       | False                                            |
| gateway_ip        | 192.168.1.254                                    |
| host_routes       |                                                  |
| id                | dbe5ea98-4f26-43e0-918d-42fad5b3b4f1             |
| ip_version        | 4                                                |
| ipv6_address_mode |                                                  |
| ipv6_ra_mode      |                                                  |
| name              | public_subnet                                    |
| network_id        | e9b19556-1846-473f-9dac-f5b53e65d6d4             |
| subnetpool_id     |                                                  |
| tenant_id         | 8adad4c02b6c43a3a5bdc705596ff938                 |
+-------------------+--------------------------------------------------+

Now we’ll create our Nuage demo tenant.


[root@ocs01 ~(keystone_admin)]# openstack project create --enable nuage
+-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| description | None                             |
| enabled     | True                             |
| id          | 16ce36b9f7d54b518b02f001e7170821 |
| name        | nuage                            |
+-------------+----------------------------------+
[root@ocs01 ~(keystone_admin)]# openstack user create --project nuage --password foo --email mau@nuage.lab --enable nuage
+------------+----------------------------------+
| Field      | Value                            |
+------------+----------------------------------+
| email      | mau@nuage.lab                    |
| enabled    | True                             |
| id         | 06df4f2fa1ee4064b33c54bce7c7e7db |
| name       | nuage                            |
| project_id | 16ce36b9f7d54b518b02f001e7170821 |
| username   | nuage                            |
+------------+----------------------------------+
[root@ocs01 ~(keystone_admin)]# curl http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img | glance \
>          image-create --name='cirros image' --visibility=public --container-format=bare --disk-format=qcow2
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 12.6M  100 12.6M    0     0  1366k      0  0:00:09  0:00:09 --:--:-- 1540k
+------------------+--------------------------------------+
| Property         | Value                                |
+------------------+--------------------------------------+
| checksum         | ee1eca47dc88f4879d8a229cc70a07c6     |
| container_format | bare                                 |
| created_at       | 2016-04-21T01:11:11Z                 |
| disk_format      | qcow2                                |
| id               | 34d46776-1a40-46d4-895b-cb626d50a200 |
| min_disk         | 0                                    |
| min_ram          | 0                                    |
| name             | cirros image                         |
| owner            | 487c319958fb4e3097ba1cd7fa0e3ca9     |
| protected        | False                                |
| size             | 13287936                             |
| status           | active                               |
| tags             | []                                   |
| updated_at       | 2016-04-21T01:11:19Z                 |
| virtual_size     | None                                 |
| visibility       | public                               |
+------------------+--------------------------------------+
[root@ocs01 ~(keystone_admin)]# cp keystonerc_admin keystonerc_nuage
#
# Editing file keystonerc_nuage
#
[root@ocs01 ~(keystone_admin)]# cat keystonerc_nuage
unset OS_SERVICE_TOKEN
export OS_USERNAME=nuage
export OS_PASSWORD=foo
export OS_AUTH_URL=http://192.168.1.15:5000/v2.0
export PS1='[\u@\h \W(keystone_nuage)]\$ '

export OS_TENANT_NAME=nuage
export OS_REGION_NAME=RegionOne

We’ll switch over our new tenant to create a router and connect it to our external_network. That way, any instance connected to this router could be got a floating address on the range that we’ve just prepared.


[root@ocs01 ~(keystone_admin)]# . keystonerc_nuage
[root@ocs01 ~(keystone_nuage)]# neutron router-create router1
Created a new router:
+-----------------------+--------------------------------------+
| Field                 | Value                                |
+-----------------------+--------------------------------------+
| admin_state_up        | True                                 |
| external_gateway_info |                                      |
| id                    | 36883167-2404-47cf-a86f-bab47d6684a8 |
| name                  | router1                              |
| routes                |                                      |
| status                | ACTIVE                               |
| tenant_id             | 16ce36b9f7d54b518b02f001e7170821     |
+-----------------------+--------------------------------------+
[root@ocs01 ~(keystone_nuage)]# neutron router-gateway-set router1 external_network
Set gateway for router router1
[root@ocs01 ~(keystone_nuage)]# neutron net-create nuage-lab
Created a new network:
+-----------------+--------------------------------------+
| Field           | Value                                |
+-----------------+--------------------------------------+
| admin_state_up  | True                                 |
| id              | d46b2c8a-5ed1-4bb7-bac5-053bb4a8bfc9 |
| mtu             | 0                                    |
| name            | nuage-lab                            |
| router:external | False                                |
| shared          | False                                |
| status          | ACTIVE                               |
| subnets         |                                      |
| tenant_id       | 16ce36b9f7d54b518b02f001e7170821     |
+-----------------+--------------------------------------+
[root@ocs01 ~(keystone_nuage)]# neutron subnet-create --name nuage-subnet nuage-lab 192.168.101.0/24
Created a new subnet:
+-------------------+------------------------------------------------------+
| Field             | Value                                                |
+-------------------+------------------------------------------------------+
| allocation_pools  | {"start": "192.168.101.2", "end": "192.168.101.254"} |
| cidr              | 192.168.101.0/24                                     |
| dns_nameservers   |                                                      |
| enable_dhcp       | True                                                 |
| gateway_ip        | 192.168.101.1                                        |
| host_routes       |                                                      |
| id                | 7bb59ca6-7547-4134-a6a1-af0ff166525a                 |
| ip_version        | 4                                                    |
| ipv6_address_mode |                                                      |
| ipv6_ra_mode      |                                                      |
| name              | nuage-subnet                                         |
| network_id        | d46b2c8a-5ed1-4bb7-bac5-053bb4a8bfc9                 |
| subnetpool_id     |                                                      |
| tenant_id         | 16ce36b9f7d54b518b02f001e7170821                     |
+-------------------+------------------------------------------------------+
[root@ocs01 ~(keystone_nuage)]# neutron router-interface-add router1 nuage-subnet
Added interface 29e44fd3-0ac3-4fa1-a479-ea1f12f4646a to router router1.

Following you will see how our router has been set:


[root@ocs01 ~(keystone_nuage)]# neutron router-show router1
+-----------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Field                 | Value                                                                                                                                                                                    |
+-----------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| admin_state_up        | True                                                                                                                                                                                     |
| external_gateway_info | {"network_id": "e9b19556-1846-473f-9dac-f5b53e65d6d4", "enable_snat": true, "external_fixed_ips": [{"subnet_id": "dbe5ea98-4f26-43e0-918d-42fad5b3b4f1", "ip_address": "192.168.1.17"}]} |
| id                    | 36883167-2404-47cf-a86f-bab47d6684a8                                                                                                                                                     |
| name                  | router1                                                                                                                                                                                  |
| routes                |                                                                                                                                                                                          |
| status                | ACTIVE                                                                                                                                                                                   |
| tenant_id             | 16ce36b9f7d54b518b02f001e7170821                                                                                                                                                         |
+-----------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

Now, I’ll take from horizon.

I’ve created a cirrus instance to test my new brand openstack implementation:

packstack install pinrojas neutron nuage demo at home 01

As you can see over the following picture, I have direct access to my Laptop’s IP address from my cirrus instance 😉

packstack install pinrojas neutron nuage demo at home 03.png

See you over the next part!

 

One thought on “Building a Nuage/OpenStack demo at Home: Giving PackStack a chance – Centos7

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s