Custom Search

Wednesday, October 28, 2015

Trying to register the VirtualBox kernel modules using DKMSError! Your kernel headers for kernel 3.13.0-63-generic cannot be found

1)
$ sudo -E apt-get install virtualbox-5.0

Reading package lists... Done
Building dependency tree      
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libgsoap4 libvncserver0
Use 'apt-get autoremove' to remove them.
Recommended packages:
  libsdl-ttf2.0-0 pdf-viewer
The following NEW packages will be installed:
  virtualbox-5.0
0 upgraded, 1 newly installed, 0 to remove and 56 not upgraded.
Need to get 0 B/63.1 MB of archives.
After this operation, 154 MB of additional disk space will be used.
Preconfiguring packages ...
Selecting previously unselected package virtualbox-5.0.
(Reading database ... 85359 files and directories currently installed.)
Preparing to unpack .../virtualbox-5.0_5.0.8-103449~Ubuntu~trusty_amd64.deb ...
Unpacking virtualbox-5.0 (5.0.8-103449~Ubuntu~trusty) ...
Processing triggers for ureadahead (0.100.0-16) ...
Processing triggers for shared-mime-info (1.2-0ubuntu3) ...
Processing triggers for mime-support (3.54ubuntu1.1) ...
Setting up virtualbox-5.0 (5.0.8-103449~Ubuntu~trusty) ...
addgroup: The group `vboxusers' already exists as a system group. Exiting.
Stopping VirtualBox kernel modules ...done.
Uninstalling old VirtualBox DKMS kernel modules ...done.
Trying to register the VirtualBox kernel modules using DKMSError! Your kernel headers for kernel 3.13.0-63-generic cannot be found.
Please install the linux-headers-3.13.0-63-generic package,
or use the --kernelsourcedir option to tell DKMS where it's located
 ...failed!
  (Failed, trying without DKMS)
Recompiling VirtualBox kernel modules ...failed!
  (Look at /var/log/vbox-install.log to find out what went wrong)
$

2)
$ sudo -E apt-get install linux-headers-3.13.0-63-generic

Reading package lists... Done
Building dependency tree      
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libgsoap4 libvncserver0
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  linux-headers-3.13.0-63
The following NEW packages will be installed:
  linux-headers-3.13.0-63 linux-headers-3.13.0-63-generic
0 upgraded, 2 newly installed, 0 to remove and 56 not upgraded.
Need to get 9,579 kB of archives.
After this operation, 76.8 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://in.archive.ubuntu.com/ubuntu/ trusty-security/main linux-headers-3.13.0-63 all 3.13.0-63.103 [8,874 kB]
Get:2 http://in.archive.ubuntu.com/ubuntu/ trusty-security/main linux-headers-3.13.0-63-generic amd64 3.13.0-63.103 [705 kB]
Fetched 9,579 kB in 0s (43.6 MB/s)                      
Selecting previously unselected package linux-headers-3.13.0-63.
(Reading database ... 86137 files and directories currently installed.)
Preparing to unpack .../linux-headers-3.13.0-63_3.13.0-63.103_all.deb ...
Unpacking linux-headers-3.13.0-63 (3.13.0-63.103) ...
Selecting previously unselected package linux-headers-3.13.0-63-generic.
Preparing to unpack .../linux-headers-3.13.0-63-generic_3.13.0-63.103_amd64.deb ...
Unpacking linux-headers-3.13.0-63-generic (3.13.0-63.103) ...
Setting up linux-headers-3.13.0-63 (3.13.0-63.103) ...
Setting up linux-headers-3.13.0-63-generic (3.13.0-63.103) ...
Examining /etc/kernel/header_postinst.d.
run-parts: executing /etc/kernel/header_postinst.d/dkms 3.13.0-63-generic /boot/vmlinuz-3.13.0-63-generic
$

3)
$ sudo -E apt-get install virtualbox-5.0

Reading package lists... Done
Building dependency tree      
Reading state information... Done
virtualbox-5.0 is already the newest version.
The following packages were automatically installed and are no longer required:
  libgsoap4 libvncserver0
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 56 not upgraded.
$

4)
$ sudo -E apt-get purge virtualbox-5.0

Reading package lists... Done
Building dependency tree      
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libaudio2 libcaca0 libgsoap4 libice6 libqt4-declarative libqt4-network
  libqt4-opengl libqt4-script libqt4-sql libqt4-xml libqt4-xmlpatterns
  libqtcore4 libqtdbus4 libqtgui4 libsdl1.2debian libsm6 libvncserver0 libvpx1
  libxmu6 libxt6 qtcore4-l10n
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
  virtualbox-5.0*
0 upgraded, 0 newly installed, 1 to remove and 56 not upgraded.
After this operation, 154 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 110957 files and directories currently installed.)
Removing virtualbox-5.0 (5.0.8-103449~Ubuntu~trusty) ...
Purging configuration files for virtualbox-5.0 (5.0.8-103449~Ubuntu~trusty) ...
Processing triggers for mime-support (3.54ubuntu1.1) ...
Processing triggers for shared-mime-info (1.2-0ubuntu3) ...
$

5)
$ sudo -E apt-get install virtualbox-5.0

Reading package lists... Done
Building dependency tree      
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libgsoap4 libvncserver0
Use 'apt-get autoremove' to remove them.
Recommended packages:
  libsdl-ttf2.0-0 pdf-viewer
The following NEW packages will be installed:
  virtualbox-5.0
0 upgraded, 1 newly installed, 0 to remove and 56 not upgraded.
Need to get 0 B/63.1 MB of archives.
After this operation, 154 MB of additional disk space will be used.
Preconfiguring packages ...
Selecting previously unselected package virtualbox-5.0.
(Reading database ... 110179 files and directories currently installed.)
Preparing to unpack .../virtualbox-5.0_5.0.8-103449~Ubuntu~trusty_amd64.deb ...
Unpacking virtualbox-5.0 (5.0.8-103449~Ubuntu~trusty) ...
Processing triggers for ureadahead (0.100.0-16) ...
Processing triggers for shared-mime-info (1.2-0ubuntu3) ...
Processing triggers for mime-support (3.54ubuntu1.1) ...
Setting up virtualbox-5.0 (5.0.8-103449~Ubuntu~trusty) ...
addgroup: The group `vboxusers' already exists as a system group. Exiting.
Stopping VirtualBox kernel modules ...done.
Uninstalling old VirtualBox DKMS kernel modules ...done.
Trying to register the VirtualBox kernel modules using DKMS ...done.
Starting VirtualBox kernel modules ...done.

$

GPG error: http://download.virtualbox.org trusty InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 54422A4B98AB5139

1)
$ cat /etc/apt/sources.list

# Repos managed by puppet.
deb http://download.virtualbox.org/virtualbox/debian trusty contrib

2)
$ sudo -E apt-get update

Get:1 http://download.virtualbox.org trusty InRelease [7,152 B]
Ign http://download.virtualbox.org trusty InRelease <====IMP
....
Hit http://in.archive.ubuntu.com trusty/multiverse amd64 Packages
Fetched 7,152 B in 4s (1,451 B/s)           
Reading package lists... Done
W: GPG error: http://download.virtualbox.org trusty InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 54422A4B98AB5139
$

3)
$ sudo -E apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 54422A4B98AB5139

Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --homedir /tmp/tmp.KEq2FDuXPb --no-auto-check-trustdb --trust-model always --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyring /etc/apt/trusted.gpg.d/puppetlabs-keyring.gpg --keyring /etc/apt/trusted.gpg.d/puppetlabs-nightly-keyring.gpg --keyring /etc/apt/trusted.gpg.d/rustedhalo.gpg --keyserver keyserver.ubuntu.com --recv-keys 54422A4B98AB5139
gpg: requesting key 98AB5139 from hkp server keyserver.ubuntu.com
gpg: key 98AB5139: public key "Oracle Corporation (VirtualBox archive signing key) " imported
gpg: Total number processed: 1
gpg:               imported: 1

$

4)
$ sudo -E apt-get update

Get:1 http://download.virtualbox.org trusty InRelease [7,152 B]
Get:2 http://download.virtualbox.org trusty/contrib amd64 Packages [1,545 B]  <====IMP
....
Hit http://in.archive.ubuntu.com trusty/multiverse amd64 Packages
Fetched 8,697 B in 4s (1,760 B/s)           
Reading package lists... Done
$

Wednesday, October 21, 2015

Debugging with GDB C++

1)
$gdb
* Open gdb

2)
(gdb) attach [process-id]
* Attach to a process

* Detach process from GDB before quiting GDB.
(gdb) detach [process-id]
(gdb) quit

3)
(gdb) info files

4)
(gdb) info function

5)
(gdb) b FlowEntry::DoPolicy
* Add breakpoint

6)
(gdb) info breakpoints
(gdb) info break
* A backtrace is a summary of how your program got where it is. It shows one line per frame, for many frames, starting with the currently executing frame (frame zero), followed by its caller (frame one), and on up the stack.
* https://sourceware.org/gdb/onlinedocs/gdb/Backtrace.html

7)
(gdb) del 2
* Delete a breakpoint

8)
(gdb) run/r
* Let it run and stop at breakpoint.

9)
(gdb) bt
OR
(gdb) backtrace
* Print the location

10)
(gdb) next
* If you want to execute the entire function with one keypress, type "next" or "n".

11)
(gdb) step
* To execute one line of code, type "step" or "s". If the line to be executed is a function call, gdb will step into that function and start executing its code one line at a time.

12)
* Print variable
(gdb) p var1
(gdb) print var1

* Run following command to format the print output
(gdb) set print pretty

13)
* Print current line and line number with few lines before and after
(gdb) list *$rip

14)
* Print current line
(gdb) frame

15)
* Print current line and more info with the function name
(gdb) where

16)
* Display a few lines of your source program around the current location
(gdb) l
OR
(gdb) list

17)
* print the data type of a variable
* You can even use ptype to look at structures
(gdb) ptype var1
OR
(gdb) pt var1







Wednesday, October 14, 2015

Fix OpenStack Nova instance stuck in BUILD scheduling state

1)
Check "/etc/oslo/matchmaker_ring.json" and remove invalid nodes
$vim /etc/oslo/matchmaker_ring.json

2)
Restart nova-conductor
$service nova-conductor restart

3)
Try to launch a new VM

Find service/client connected to contrail vrouter agent port 9090

1)
Check the service/client which connected to vrouter agent port 9090
#netstat -pant | grep 9090
tcp        0      0 0.0.0.0:9090            0.0.0.0:*               LISTEN      56238/contrail-vrou
tcp        0      0 127.0.0.1:9090          127.0.0.1:52856         ESTABLISHED 56238/contrail-vrou
tcp        0      0 127.0.0.1:52856         127.0.0.1:9090          ESTABLISHED 64005/python


2)
Check the service/client which connected to vrouter agent port 9090
$lsof -i :9090
COMMAND     PID USER   FD   TYPE   DEVICE SIZE/OFF NODE NAME
contrail- 15486 root   51u  IPv4 13415815      0t0  TCP *:9090 (LISTEN)
contrail- 15486 root   53u  IPv4 13432972      0t0  TCP localhost:9090->localhost:41731 (ESTABLISHED)
nova-comp 55059 nova   52u  IPv4 13439027      0t0  TCP localhost:41731->localhost:9090 (ESTABLISHED)

2a)
How to map an ephemeral port to a pid
$sudo lsof -i :41731
$sudo lsof -i tcp:41731 <--- pid="" show="" span="">

$sudo fuser 41731

3)
Find the service/client using PID
$ps -aux | grep 55059
root     42138  0.0  0.0  10460   936 pts/6    S+   16:00   0:00 grep --color=auto 55059
nova     55059  1.1  0.0 2827008 88796 ?       Ssl  02:28   9:23 /usr/bin/python /usr/bin/nova-compute --config-file=/etc/nova/nova.conf --config-file=/etc/nova/nova-compute.conf


4)
Stop nova compute
$service nova-compute stop
nova-compute stop/waiting

5)
Check the service/client which connected to vrouter agent port 9090
$lsof -i :9090
COMMAND     PID USER   FD   TYPE   DEVICE SIZE/OFF NODE NAME
contrail- 15486 root   51u  IPv4 13415815      0t0  TCP *:9090 (LISTEN)

6)
Find vrouter agent process
$ps -aux | grep 15486
root     15486  1.6  0.0 2434356 88660 ?       Sl   13:59   2:16 /usr/bin/contrail-vrouter-agent --config_file /etc/contrail/contrail-vrouter-agent.conf













OpenStack kilo opencontrail vif driver fix NovaException: vif_type parameter must be present for this vif_driver implementation

Fix
===========

1)
a)
#vim /etc/nova/nova.con
nova_contrail_vif.contrailvif.ContrailNetworkAPI

b)
Restart nova-compute
#service  nova-compute restar

c)
#nova boot ---

2) OR
 
JUNO/KILO release doesn't support libvirt_vif_driver configuration in nova.conf
vif_driver is set to LibvirtGenericVIFDriver. plug/unplug/get_config api from
this class doesn't support opencontrail. Till opencontrail vif_driver is
upstreamed, overwrite the vif_driver with VRouterVIFDriver


https://github.com/Juniper/contrail-nova-vif-driver/blob/88a1fb67919056818ecfff2d462120f3c4693831/nova_contrail_vif/contrailvif.py#L42

a)
$vim /usr/lib/python2.7/dist-packages/nova/virt/libvirt/driver.py

##SM
from nova_contrail_vif.contrailvif import VRouterVIFDriver =====

class LibvirtDriver(driver.ComputeDriver):

    def __init__(self, virtapi, read_only=False):
        ##SM
        self.vif_driver = VRouterVIFDriver() =====
        #self.vif_driver = libvirt_vif.LibvirtGenericVIFDriver()

b)
$service  nova-compute restart
$tail -f /var/log/nova/nova-compute.log

Error
===========

$/var/log/nova/nova-compute.log

2015-06-10 19:44:05.482 7765 ERROR nova.compute.manager [req-820a22fd-b835-45e3-b654-805e68adbd2e 8029c48a21654b51bea88039dbd140a8 ada49dd0f0a8429ca2b91cc120b8437c - - -] [instance: 675c279e-3380-47d4-9050-a24d8b0ff59b] Instance failed to spawn
2015-06-10 19:44:05.482 7765 TRACE nova.compute.manager [instance: 675c279e-3380-47d4-9050-a24d8b0ff59b] Traceback (most recent call last):
2015-06-10 19:44:05.482 7765 TRACE nova.compute.manager [instance: 675c279e-3380-47d4-9050-a24d8b0ff59b]   File "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 2461, in _build_resources
2015-06-10 19:44:05.482 7765 TRACE nova.compute.manager [instance: 675c279e-3380-47d4-9050-a24d8b0ff59b]     yield resources
2015-06-10 19:44:05.482 7765 TRACE nova.compute.manager [instance: 675c279e-3380-47d4-9050-a24d8b0ff59b]   File "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 2333, in _build_and_run_instance
2015-06-10 19:44:05.482 7765 TRACE nova.compute.manager [instance: 675c279e-3380-47d4-9050-a24d8b0ff59b]     block_device_info=block_device_info)
2015-06-10 19:44:05.482 7765 TRACE nova.compute.manager [instance: 675c279e-3380-47d4-9050-a24d8b0ff59b]   File "/usr/lib/python2.7/dist-packages/nova/virt/libvirt/driver.py", line 2382, in spawn
2015-06-10 19:44:05.482 7765 TRACE nova.compute.manager [instance: 675c279e-3380-47d4-9050-a24d8b0ff59b]     write_to_disk=True)
2015-06-10 19:44:05.482 7765 TRACE nova.compute.manager [instance: 675c279e-3380-47d4-9050-a24d8b0ff59b]   File "/usr/lib/python2.7/dist-packages/nova/virt/libvirt/driver.py", line 4183, in _get_guest_xml
2015-06-10 19:44:05.482 7765 TRACE nova.compute.manager [instance: 675c279e-3380-47d4-9050-a24d8b0ff59b]     context)
2015-06-10 19:44:05.482 7765 TRACE nova.compute.manager [instance: 675c279e-3380-47d4-9050-a24d8b0ff59b]   File "/usr/lib/python2.7/dist-packages/nova/virt/libvirt/driver.py", line 4054, in _get_guest_config
2015-06-10 19:44:05.482 7765 TRACE nova.compute.manager [instance: 675c279e-3380-47d4-9050-a24d8b0ff59b]     flavor, virt_type)
2015-06-10 19:44:05.482 7765 TRACE nova.compute.manager [instance: 675c279e-3380-47d4-9050-a24d8b0ff59b]   File "/usr/lib/python2.7/dist-packages/nova/virt/libvirt/vif.py", line 368, in get_config
2015-06-10 19:44:05.482 7765 TRACE nova.compute.manager [instance: 675c279e-3380-47d4-9050-a24d8b0ff59b]     _("vif_type parameter must be present "
2015-06-10 19:44:05.482 7765 TRACE nova.compute.manager [instance: 675c279e-3380-47d4-9050-a24d8b0ff59b] NovaException: vif_type parameter must be present for this vif_driver implementation
2015-06-10 19:44:05.482 7765 TRACE nova.compute.manager [instance: 675c279e-3380-47d4-9050-a24d8b0ff59b]
2015-06-10 19:44:05.486 7765 INFO nova.compute.manager [req-820a22fd-b835-45e3-b654-805e68adbd2e 8029c48a21654b51bea88039dbd140a8 ada49dd0f0a8429ca2b91cc120b8437c - - -] [instance: 675c279e-3380-47d4-9050-a24d8b0ff59b] Terminating instance

how to get openstack kilo ubuntu PGP PUBLIC KEY

1)
$sudo add-apt-repository cloud-archive:kilo

2)
$apt-key list

3)
$apt-key export [key_from_above_command] 

4)
Example:
$apt-key export EC4926EA

-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1

mQINBFAqSlgBEADPKwXUwqbgoDYgR20zFypxSZlSbrttOKVPEMb0HSUx9Wj8VvNC
r+mT4E9wAyq7NTIs5ad2cUhXoyenrjcfGqK6k9R6yRHDbvAxCSWTnJjw7mzsajDN
ocXC6THKVW8BSjrh0aOBLpht6d5QCO2vyWxw65FKM65GOsbX03ZngUPMuOuiOEHQ
Zo97VSH2pSB+L+B3d9B0nw3QnU8qZMne+nVWYLYRXhCIxSv1/h39SXzHRgJoRUFH
vL2aiiVrn88NjqfDW15HFhVJcGOFuACZnRA0/EqTq0qNo3GziQO4mxuZi3bTVL5s
GABiYW9uIlokPqcS7Fa0FRVIU9R+bBdHZompcYnKAeGag+uRvuTqC3MMRcLU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MUXIcEwjVEIvewJuqBW/3rj3Hh14tmWjQ7shNnYBuSJwbLeUW2e8bURnfXE
TxrCmXzDmQldD5GQWCcD5WDosk/HVHBmHlqrqy0VO2nE3c73dQlNcI4jVWeC4b4Q
SpYVsFz/6Iqy5ZQkCOpQ57MCf0B6P5nF92c5f3TYPMxHf0x3DrjDbUVZytxDiZZa
XsbZzsejbbc1bSNp4hb+IWhmWoFnq/hNHXzKPHBTapObnQju+9zUlQngV0BlPT62
hOHOw3Pv7suOuzzfuOO7qpz0uAy8cFKe7kBtLSFVjBwaG5JX89mgttYW+lw9Rmsb
p9Iw4KKFHIBLOwk7s+u0LUhP3d8neBI6NfkOYKZZCm3CuvkiOeQP9/2okFjtj+29
jEL+9KQwrGNFEVNe85Un5MJfYIjgyqX3nJcwypYxidntnhMhr2VD3HL2R/4CiswB
Oa4g9309p/+af/HU1smBrOfIeRoxb8jQoHu3
=xg4S
-----END PGP PUBLIC KEY BLOCK-----

Tuesday, October 13, 2015

openstack glance image-create error Unexpected EOF

Fix
===

https://review.openstack.org/#/c/142952/4/glanceclient/common/http.py

/usr/lib/python2.7/dist-packages/glanceclient/common/http.py


Error
=====

 $glance --debug image-create --progress --name cirros-0.3.3 --disk-format qcow2 --container-format bare --is-public True --file cirros-0.3.2-i386-disk.img
curl -i -X POST -H 'Accept-Encoding: gzip, deflate, compress' -H 'x-image-meta-container_format: bare' -H 'Accept: */*' -H 'X-Auth-Token: {SHA1}c18891d276885a33f8799b559148e8f8fd6ba27e' -H 'x-image-meta-size: 12336128' -H 'x-image-meta-is_public: True' -H 'User-Agent: python-glanceclient' -H 'Content-Type: application/octet-stream' -H 'x-image-meta-disk_format: qcow2' -H 'x-image-meta-name: cirros-0.3.3'  --cert None --key None https://image.jcloud.com:9292/v1/images
[=============================>] 100%
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/glanceclient/shell.py", line 637, in main
    args.func(client, args)
  File "/usr/lib/python2.7/dist-packages/glanceclient/v1/shell.py", line 232, in do_image_create
    image = gc.images.create(**fields)
  File "/usr/lib/python2.7/dist-packages/glanceclient/v1/images.py", line 288, in create
    data=image_data)
  File "/usr/lib/python2.7/dist-packages/glanceclient/common/http.py", line 262, in post
    return self._request('POST', url, **kwargs)
  File "/usr/lib/python2.7/dist-packages/glanceclient/common/http.py", line 206, in _request
    **kwargs)
  File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 455, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 558, in send
    r = adapter.send(request, **kwargs)
  File "/usr/lib/python2.7/dist-packages/requests/adapters.py", line 353, in send
    low_conn.send(i)
  File "/usr/lib/python2.7/httplib.py", line 811, in send
    self.sock.sendall(data)
  File "/usr/lib/python2.7/dist-packages/urllib3/contrib/pyopenssl.py", line 291, in sendall
    return self.connection.sendall(data)
SysCallError: (-1, 'Unexpected EOF')
(-1, 'Unexpected EOF')
 

Friday, October 9, 2015

apt-get install WARNING: The following packages cannot be authenticated!

If you recently added PPA or repo like "$add-apt-repository cloud-archive:kilo"
Then run following commands to fix authentication WARNING

$apt-key update 

$apt-get update



Ubuntu How to rerun cloud-init manually

1)
$rm -rf /var/lib/cloud/*
OR
$rm -rf /var/lib/cloud/sem/* /var/lib/cloud/instance /var/lib/cloud/instances/*

2)
$cloud-init init

$cloud-init modules -m final


3)
$tail -f /var/log/cloud-init.log

$tail -f /var/log/cloud-init-output.log



How to run cloud-init manually

1)
$rm -rf /var/lib/cloud/*
OR
$rm -rf /var/lib/cloud/sem/* /var/lib/cloud/instance /var/lib/cloud/instances/*

2)
$cloud-init init

$cloud-init modules -m final


3)
$tail -f /var/log/cloud-init.log

$tail -f /var/log/cloud-init-output.log


Tuesday, October 6, 2015

git filter commit logs by Author and print it in single line


$git log -n 15 --pretty=oneline --author=saju myremote/contrailv2

018839692b324484aec12cd68c8fcaa13ad6c83f Added dan's changes to test upgrade
a3e907f7220471597a64d4fbfbd611390ede4a38 Added options for env specific repos
ec6f169a0549e0ecf1a7eea0fcaaedcc11cf0028 Disabling contrail-dns
6ca130da7fc11085a33a8250e69588401cf07f28 Enabled contrailv2 repos
42c8c208c4bbe50a9f47bc8e9f0dfa1b90a4a9c0 Enabled contrailv2 in AT













Monday, October 5, 2015

How To Install Stable OpenStack Liberty/Juno/Kilo with Neutron and Swift in Ubuntu 15.04 14.04

1)
Clone
$git clone https://github.com/openstack-dev/devstack.git -b stable/liberty

2)
CD to cloned devstack directory
$cd devsack

3)
Create a file named "localrc" with following content.
 
##For neutron
disable_service n-net 
enable_service q-svc q-agt q-dhcp q-l3
##For swift
enable_service s-proxy s-object s-container s-account

4)
Run stack.sh and install openstack
$./stack.sh

Time to switch to OpenStackClient unified CLI


How To Install Stable OpenStack Liberty In 2 Steps Using Devstack

1)
$git clone https://github.com/openstack-dev/devstack.git -b stable/liberty

2)
$cd devsack
$./stack.sh

How To Install Stable OpenStack Liberty In Ubuntu Using Devstack

1)
$git clone https://github.com/openstack-dev/devstack.git -b stable/liberty

2)
$cd devsack
$./stack.sh