We’ve had a couple of questions about deploying DevStack with Vagrant. In the following post, I will help provide a prescriptive process to make this easy.

  • Install Virtual Box and Vagrant
  • Spin up an Ubuntu 14.04 VM
    Akshais-MacBook-Pro:Documents akshai$ mkdir devstack_vm  
    Akshais-MacBook-Pro:devstack_vm akshai$ cd devstack_vm  
    Akshais-MacBook-Pro:devstack_vm akshai$ vagrant init ubuntu/trusty64; vagrant up --provider virtualbox
    
  • Uncomment and modify the configuration file (Vagrantfile) the following way using a text editor such as vim:
    config.vm.provider "virtualbox" do |vb|
      vb.memory = "6144"
    end
    
  • Reload the VM and connect to it
    Akshais-MacBook-Pro:devstack_vm akshai$ vagrant reload  
    Akshais-MacBook-Pro:devstack_vm akshai$ vagrant ssh
    
  • Check memory
    vagrant@vagrant-ubuntu-trusty-64:~/devstack$ cat /proc/meminfo | grep MemTotal  
    MemTotal:        6112708 kB
    

    If the memory is not ~6GB (minimum recommended is 4GB), please perform these steps to reload this DevStack VM, and check once more:

    vagrant@vagrant-ubuntu-trusty-64:~/devstack$ exit
    Akshais-MacBook-Pro:devstack_vm akshai$ vagrant reload
    Akshais-MacBook-Pro:devstack_vm akshai$ vagrant ssh
    vagrant@vagrant-ubuntu-trusty-64:~$
    
  • Install pre-requisites and clone the DevStack repository
    vagrant@vagrant-ubuntu-trusty-64:~$ sudo apt-get update
    vagrant@vagrant-ubuntu-trusty-64:~$ sudo apt-get install -y  git python-pip vim-gtk \
      libxml2-dev libxslt1-dev libpq-dev libsqlite3-dev && \
      sudo apt-get -y build-dep python-mysqldb
    vagrant@vagrant-ubuntu-trusty-64:~$ sudo pip install git-review tox
    vagrant@vagrant-ubuntu-trusty-64:~$ git clone git://git.openstack.org/openstack-dev/devstack
    vagrant@vagrant-ubuntu-trusty-64:~$ cd devstack
    

    Your console should now look something like this:

    devstack1

  • Within the devstack directory, update the local.conf file by copy-pasting the text below:
    vagrant@vagrant-ubuntu-trusty-64: devstack$ cat < __EOF__ > local.conf
    [[local|localrc]]
    ADMIN_PASSWORD=nova
    DATABASE_PASSWORD=nova
    RABBIT_PASSWORD=nova
    SERVICE_PASSWORD=nova
    SERVICE_TOKEN=nova
    GUEST_PASSWORD=nova
    MYSQL_HOST=127.0.0.1
    MYSQL_USER=root
    MYSQL_PASSWORD=nova
    RABBIT_HOST=127.0.0.1
    LIBVIRT_TYPE=qemu
    GLANCE_HOSTPORT=127.0.0.1:9292
    SWIFT_HASH=66a3d6b56c1f479c8b4e70ab5c2000f5
    SWIFT_REPLICAS=1
    SWIFT_DATA_DIR=\$DEST/data/swift
    LOGDAYS=1
    LOGFILE=\$DEST/devstack.log
    SCREEN_LOGDIR=\$DEST/logs/screen
    RECLONE=yes
    API_RATE_LIMIT=False
    
    enable_service horizon
    disable_service heat
    disable_service h-eng
    disable_service h-api
    disable_service h-api-cfn
    disable_service h-api-cw
    disable_service n-net
    enable_service neutron
    enable_service q-svc
    enable_service q-agt
    enable_service q-dhcp
    enable_service q-l3
    enable_service q-meta
    enable_service tempest
    enable_plugin manila https://github.com/openstack/manila
    Q_PLUGIN=ml2
    ENABLE_TENANT_VLANS=True
    ML2_VLAN_RANGES=physnet1:100:200
    PHYSICAL_NETWORK=physnet1
    OVS_PHYSICAL_BRIDGE=br-eth1
    Q_ML2_PLUGIN_MECHANISM_DRIVERS=openvswitch
    Q_ML2_PLUGIN_TYPE_DRIVERS=vlan,vxlan
    SHARE_BACKING_FILE_SIZE=22G
    __EOF__
    
  • Install DevStack
    ./stack.sh
    

    At the end of the install, which can take more than 20 minutes, you should see a screen similar to what’s shown below:

    devstack2

    Once you source openrc, you will be able to exercise the OpenStack CLI. In the event that the install does not end successfully, you need to unstack and clean your DevStack install before running stack once again.

Thanks to my team member, Sumit, and a couple of our Devs – Chuck and Goutham for assisting me along the way. Hope you found this helpful! Have fun with DevStack and NetApp!

Akshai Parthasarathy