Saturday, 6 January 2018

How to install openstack in ubuntu 16.04

The hardware we’ll be using is based on the following specifications:
  • 1 x MAAS Rack with Region controller: 8GB RAM, 2 CPUs, 1 NIC, 40GB storage
  • 1 x Juju node: 4GB RAM, 2 CPUs, 1 NIC, 40GB storage
  • 4 x OpenStack cloud nodes: 8GB RAM, 2 CPUs, 2 NICs, 80GB storage

Installing MAAS

root@maas:~# add-apt-repository ppa:maas/stable
root@maas:~# apt-get -y update;apt-get -y upgrade;apt-get -y dist-upgrade
root@maas:~# reboot
root@maas:~# cat /etc/lsb-release;uname -r
root@maas:~# apt-get -y update;apt-get -y install maas

NOTE: When asked for the Ubuntu MAAS API address, double check the detected URL uses eth0’s (external) IP address: /MAAS/. You can later change this by running:

root@maas:~# dpkg-reconfigure maas-rack-controller

Also, double check that running below command shows the IP of management interface same as the MAAS url.

root@maas:~# sudo dpkg-reconfigure maas-region-controller

root@maas:~# maas createadmin --username=maasadmin --password='maas@123' --email=maasadmin@maas

A final question will ask whether you want to import SSH keys. MAAS uses the public SSH key of a user to manage and secure access to deployed nodes, just as you might with managed servers or remote machines. Press Enter to skip this as we’ll do this from the web UI in the next step.

root@maas:~# maas-region apikey --username=admin > api_key
root@maas:~# maas login admin - < api_key

You are now logged in to the MAAS server at with the profile name 'admin'.

For help with the available commands, try:

  maas admin --help
A handy shell script, say, is provided:

API_KEY_FILE= /root/api_key

Once you are done with the CLI you can log out from the given profile, flushing the stored credentials.

root@maas:~# maas logout admin

Use this url to login to MAAS console.

In the intro page enter domain name, dns forwarder for name resolution if required proxy ip for syncing images and then select required ubuntu release. 

Keys: You can conveniently import your public SSH key(s) from both Launchpad and Github by entering your user id for these services. To add a local public key file, usually HOME/ssh/, select Upload and paste file contents into the box that appears. Click Import to fix the setting.

If you need to generate a local SSH public/private key pair, type ssh-keygen -t rsa from the Linux account you’ll control MAAS from, and when asked, leave the passphrase blank.

maasadmin@maas:~$ cat /home/maasadmin/.ssh/

Manually update the above key in the keys field and click import. Adding SSH keys completes this initial MAAS configuration. Click Go to the dashboard to move to the MAAS dashboard and the device discovery process

In subnets tab click on first subnet and provide dhcp range for assigning ip to other nodes for pxe boot.

In settings tab

Global Kernel Parameters field enter below values
net.ifnames=0 biosdevname=0



LVM layout

Now lets discover the nodes. Select first boot as network boot in remaining server and reboot. The servers will get booted in pxe and adds as node in MAAS server. Rename the nodes as required and select all then give commission. Click the nodes which has 2 nic cards and make sure second interface shows subnet address and ip address as unconfigured.

Now our MAAS is done. Lets fire up confure-up and configure openstack nodes.

My environment is beyond proxy so i have excluded entire subnet in no-proxy so proxy will not be used for internal connectivity.

Take putty session of MAAS server:

#conjure-up --http-proxy "" --apt-proxy "" --apt-https-proxy "" --https-proxy "" --no-proxy "localhost,,,,,,,,,,,,,,,,,,,10.10.2333.18,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,," openstack

Follow below steps in setup screen.

Select openstack with nova-kvm
select maas
Enter maas url and api key use below command to get api-key of admin user.
root@maas:~# maas-region apikey --username=admin
click next
Configure netutron-gateway to use the 2nd interface which is detected in the server.
In this deployment 2nd interface is detected as eth3 so rename the data-port: as shown below.
To do this click configure in neutron-gateway 
Scroll down to data-port: br-ex:eth3
Save and select deploy all 16 applications.

I hardly takes 30 to 60min to complete.

maasadmin@maas:~$ juju status openstack-dashboard/0|grep openstack-dashboard/0
openstack-dashboard/0*  active    idle   0/lxd/0    80/tcp,443/tcp  Unit is ready

Access the openstack url

Username: admin
Password: openstack

Post configuration

#juju config nova-cloud-controller console-access-protocol=novnc
#juju config nova-compute config-flags="default_ephemeral_format=ext4,block_device_allocate_retries=300,block_device_allocate_retries_interval=10,block_device_creation_timeout=300"
#juju config openstack-dashboard password-retrieve=true
#juju config ntp source=

Adding new machine

#juju add-machine
#juju add-unit nova-compute --to 4
#juju add-unit ceph-osd --to 4
#juju add-unit --to lxd:4 ceph-mon


Monday, 3 July 2017

HTTP TRACE / TRACK Methods Enabled (CVE-2004-2320, CVE-2010-0386, CVE-2003-1567)

Treat: "The remote Web server supports the TRACE and/or TRACK HTTP methods, which makes it easier for remote attackers to steal cookies and authentication credentials or bypass the HttpOnly protection mechanism.
Track / Trace are required to be disabled to be PCI compliance."

Impact: If this vulnerability is successfully exploited, attackers can potentially steal cookies and authentication credentials, or bypass the HttpOnly protection mechanism.

Solution: Disable these methods in your web server's configuration file.

Fix:  echo TraceEnable off >>/etc/httpd/conf/httpd.conf

Restart apache service