The repository will be used for the VMworld 2015 Chef Workshop. If you're unable to attend, or fell asleep during a portion of the workshop, feel free to clone this repository and follow along with this README.
Includes pre-configured items to help with limited time during workshop making it easier to follow along.
-
Clone this repo to your local machine
$ git clone https://github.com/vmwaredevops/vmworld-chef-repo.git
- Download latest copy of repo from this link: https://github.com/vmwaredevops/vmworld-chef-repo/archive/master.zip
- Unzip somewhere on local machine
- Double-click Chef DK Installer
- OSX - ./Chef/chefdk-0.6.2-1.dmg
- Windows - ./Chef/chefdk-0.6.2-1.msi
-
Select necessary package to download (latest as of writing is v0.7.0):
-
Run downloaded installer
-
Verify installation was successful
$ chef --version Chef Development Kit Version: 0.7.0 chef-client version: 12.4.1 berks version: 3.2.4 kitchen version: 1.4.2
- Go to https://manage.chef.io/signup/
- Fill out signup form
- Click Create New Organization
- Enter "Full Name" and "Short Name" for your organization. NOTE: Full Name can be whatever you want, but Short Name must be unique (across all hosted Chef orgs)
- Navigate to the Administration panel and select Users from the left menu. Select your user, then click "Reset Key" from that Actions menu
- Click "Reset Key" download your user pem
- Add downloaded user pem to
/vmworld-chef-repo/.chef/[username].pem
- Copy
./vmworld-chef-repo/.chef/knife.rb.example
to./vmworld-chef-repo/.chef/knife.rb
and replace the following items (we'll replace the others later:- INSERT_CHEF_USERNAME
- INSERT_CHEF_ORG_SHORTNAME
- Run
knife client list
from within your/vmworld-chef-repo/
directory to verify access to your Chef server.
-
Install knife-vcair plugin
$ chef exec gem install knife-vcair
-
Ensure
./vmworld-chef-repo/.chef/knife.rb
is up-to-date with vCloud Air configurationscurrent_dir = File.dirname(__FILE__) log_level :info log_location STDOUT node_name mychefuser client_key "#{current_dir}/mychefuser.pem" chef_server_url "https://api.opscode.com/organizations/mycheforg" cookbook_path ["#{current_dir}/../cookbooks"] # vCloud Air OnDemand Settings knife[:vcair_api_host] = "us-california-1-3.vchs.vmware.com" knife[:vcair_username] = "VCAIR USERNAME FROM SLIDES" knife[:vcair_password] = "VCAIR PASSWORD FROM SLIDES" knife[:vcair_org] = "f305cc3c-57ee-40ad-bca0-16a7d5d2a1f9" knife[:vcair_vdc] = "ChefVDC1" knife[:vcair_api_path] = '/api/compute/api'
-
Upload cookbook to the Chef Server - be sure you're in /vmworld-chef-repo/ directory
$ knife cookbook upload hello_vmworld
-
Create and bootstrap vCloud Air VM
knife vcair server create --ssh-password vmworld2015 --image "CentOS64-64BIT" --node-name YOURNAME-chef-node --customization-script bootstrap/install-linux-vcair-example.sh --run-list 'recipe[hello_vmworld::default]' --ssh-gateway [email protected] --fog-version 1.33.0 --vcair-net chef-routed-network --no-host-key-verify
If you see something along these lines:
/opt/chefdk/embedded/lib/ruby/site_ruby/2.1.0/rubygems/specification.rb:2104:in `raise_if_conflicts': Unable to activate winrm-s-0.3.1, because winrm-1.2.0 conflicts with winrm (~> 1.3.0) (Gem::ConflictError)
from /opt/chefdk/embedded/lib/ruby/site_ruby/2.1.0/rubygems/specification.rb:1282:in `activate'
from /opt/chefdk/embedded/lib/ruby/site_ruby/2.1.0/rubygems/specification.rb:1316:in `block in activate_dependencies'
from /opt/chefdk/embedded/lib/ruby/site_ruby/2.1.0/rubygems/specification.rb:1302:in `each'
from /opt/chefdk/embedded/lib/ruby/site_ruby/2.1.0/rubygems/specification.rb:1302:in `activate_dependencies'
from /opt/chefdk/embedded/lib/ruby/site_ruby/2.1.0/rubygems/specification.rb:1284:in `activate'
from /opt/chefdk/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:117:in `require'
Try running chef exec gem uninstall winrm -v 1.2.0
- Learn Chef
- ESXi
- Fusion and Workstation
- vCloud Air
- vSphere
- VMware Integrated OpenStack