Skip to content

Instantly share code, notes, and snippets.

@mattray
Created May 14, 2014 13:07
Show Gist options
  • Save mattray/f5141f3f6cb0be4cfc5d to your computer and use it in GitHub Desktop.
Save mattray/f5141f3f6cb0be4cfc5d to your computer and use it in GitHub Desktop.
OpenStack Atlanta Chef Workshop Instructions

Welcome to the OpenStack Deployment with Chef Workshop. These instructions are tailored to provide the minimal configuration for doing the walk-through. There is an expectation of Chef familiarity, but the steps are the same used in the presentation.

User shell commands will start with '$' or '#' for the 'root' user on the Virtualbox image.

1. Install Virtualbox. We are currently using 4.3.10. You may download it from https://Virtualbox.com

2. Install Vagrant. We are currently using 1.4.3. You may download it from https://downloads.vagrantup.com

3. Install the Chef Development Kit. We are currently using 0.1.0. You may download it from https://www.getchef.com/downloads/chef-dk/

4. The Chef repository for the session is the stable/havana branch from Stackforge. You may download it from https://github.com/stackforge/openstack-chef-repo

5. Install the following Vagrant plugins:

$ vagrant plugin install vagrant-omnibus
$ vagrant plugin install vagrant-chef-zero

6. Check that the plugins are successfully installed:

$ vagrant plugin list
  vagrant-chef-zero (0.6.0)
  vagrant-omnibus (1.3.0)

7. In your openstack-chef-repo, make sure you are on the stable\havana branch.

$ cd openstack-chef-repo
$ git co stable\havana

8. Use Berkshelf to download the Chef cookbooks specified in the Berksfile.

$ berks vendor .cookbooks

9. Set an environment file to specify which Vagrantfile to use, for example:

$ export VAGRANT_VAGRANTFILE=Vagrantfile-aio-nova

10. Install the Virtualbox image we will be using for the demo from one of the mirrors:

$ vagrant box add opscode-ubuntu-12.04 http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_ubuntu-12.04_chef-provisionerless.box

11. Start up the Vagrant virtual machine with the following command:

$ vagrant up ubuntu1204

12. SSH into the Vagrant virtual machine once it has completed the installation:

$ vagrant ssh ubuntu1204

13. Become the 'root' user:

$ sudo su -

14. Source the openrc file to configure the root user's environment for OpenStack:

# source openrc

15. List the Nova Compute services that are running:

# nova service-list

16. List the Nova Compute hypervisors that are running:

# nova hypervisor-list

17. List the images available for creating instances:

# nova image-list

18. Boot a very small test instance:

# nova boot test1 --image cirros --flavor 1 --poll

19. List the instances that are currently running:

# nova list

21. Inspect the running test instance:

# nova show test1

22. SSH into the image, the user is 'cirros' and the password is 'cubswin:)':

# ssh cirros@192.168.100.2
The authenticity of host '192.168.100.2 (192.168.100.2)' can't be established.
RSA key fingerprint is 90:c5:8c:9c:f7:73:b4:54:cf:15:0d:28:54:7f:e7:19.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.100.2' (RSA) to the list of known hosts.
cirros@192.168.100.2's password:
$ uptime
 06:55:23 up 2 min, load average: 0.01, 0.02, 0.01

23. Connect to the OpenStack Dashboard:

https://localhost:8443

24. Create a zero.rb file for interacting with your Vagrant deployed OpenStack:

chef_server_url   'http://10.10.6.135:4002'
node_name         'mray'
client_key        '.chef/mray.pem'

knife[:openstack_username] = "admin"
knife[:openstack_password] = "admin"
knife[:openstack_tenant]   = "admin"
knife[:openstack_auth_url] = "http://127.0.0.1:5000/v2.0/tokens"

25. Test with commands

knife node list -c zero.rb

26. Logout of the instance and exit the Vagrant virtual machine. Destroy the Vagrant VM:

$ vagrant destroy ubuntu1204 -f
@tracyajones
Copy link

I really enjoyed your talk today and am trying it out on my laptop (mac). when I install vagrant-chef-zero i get an issue wit the dependencies - though i manually installed them.

/Applications/Vagrant/embedded/lib/ruby/1.9.1/rubygems/dependency_installer.rb:153:in gather_dependencies': Unable to resolve dependencies: chef requires mixlib-config (~> 2.0), mixlib-cli (~> 1.4), mixlib-authentication (~> 1.3), mixlib-shellout (~> 1.4), ohai (~> 7.0.4), rest-client (< 1.7.0, >= 1.0.4), mime-types (~> 1.16), yajl-ruby (~> 1.1), net-ssh (~> 2.6), net-ssh-multi (~> 1.1), highline (>= 1.6.9, ~> 1.6), erubis (~> 2.7), diff-lcs (>= 1.2.4, ~> 1.2), pry (~> 0.9); ridley requires celluloid (~> 0.16.0.pre), celluloid-io (~> 0.16.0.pre), erubis (>= 0), faraday (~> 0.9.0), mixlib-authentication (>= 1.3.0), net-http-persistent (>= 2.8), retryable (>= 0), semverse (~> 1.1); buff-shell_out requires buff-ruby_engine (~> 0.1.0) (Gem::DependencyError) from /Applications/Vagrant/embedded/lib/ruby/1.9.1/rubygems/dependency_installer.rb:267:ininstall'

@RobertRehberg
Copy link

I ventured out trying not to do the chef-dk thing as I had most of the tools already, however I stumbled a bit on the berks vendor command. Just a note to anyone running into this, that command is not available in the version specified in the gemfile, you need to gem install a newer version of berkshelf (I got latest).

One other problem I hit was with installing vagrant was an error with nokogiri (I can't recall a gem problem I've had that didn't involve that gem somewhere). The export suggestion in this link http://stackoverflow.com/questions/23621717/vagrant-plugin-and-nokogiri-install-issue was the answer for me.

@RobertRehberg
Copy link

Getting a nasty error from the vagrant up command

Ridley::Client::ConnectionSupervisor crashed!
KeyError: key not found: :retries

the .zero-knife.rb file does have my local ip. I installed chef dk after seeing this error and can get a version from chef zero, but I still get the same error.

I am running Mountain Lion, chef -v doesn't work and saw this chef/omnibus-software#170

I'm guessing you guys are on 10.9?

@Limilo
Copy link

Limilo commented May 16, 2014

Similar problems here using Ubuntu. I've spent a lot of the last week trying to get the master branch working and was hoping stable/havana would be a bit easier. Unfortunately the problems are more or less the same.

It looks as though the chef-zero plugin is unfortunately dead - couldn't get it to work no matter which version I downloaded using vagrant plugin.

I eventually amended the Vagrantfile to use chef-solo (and also tried working with a full chef server install and chef-client). In the branch used here, that gets past the dependency and Ridley crash errors above, but results in:

Chef::Exceptions::RecipeNotFound

could not find recipe ruby for cookbook mysql

This seems to be caused by a change in the mysql cookbook of late which has somehow ended up in here. Perhaps the Berksfile needs amending?

@amlee
Copy link

amlee commented May 30, 2014

This looks like dead path. I tried and run into the same problem as RobertRehberg. I have Mac OSX 10.9 and chef -v:
Chef Development Kit Version: 0.1.0
But still have the same problem "/Applications/Vagrant/embedded/gems/gems/i18n-0.6.9/lib/i18n/core_ext/hash.rb:4:in `fetch': key not found: :retries (KeyError)"

@thierrymarianne
Copy link

In 7., you meant $ git co stable\havana, didn't you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment