Writing a Knife Plugin for yourshiny new VMWare vCloudDirectorChirag Jog, CTO Clogenychirag@clogeny.comInnovation → Execut...
http://www.clogeny.com© 2012 Clogeny TechnologiesAbout MeBuilt cutting edgeproducts:• Hybrid Cloud MigrationAppliances• En...
http://www.clogeny.com© 2012 Clogeny TechnologiesAgenda What is the knife plugins ? The Knife cloud plugin framework VM...
http://www.clogeny.com© 2012 Clogeny TechnologiesWhat are knife cloud plugins ?Extend Knife to support additional function...
http://www.clogeny.com© 2012 Clogeny TechnologiesAvailable Cloud Plugins
http://www.clogeny.com© 2012 Clogeny TechnologiesKnife Plugin Usagegem install knife-<cloudname>
http://www.clogeny.com© 2012 Clogeny TechnologiesKnife Plugin Usagegem install knife-<cloudname>knife <cloudname> server c...
http://www.clogeny.com© 2012 Clogeny TechnologiesKnife Plugin Usagegem install knife-<cloudname>knife <cloudname> server c...
http://www.clogeny.com© 2012 Clogeny TechnologiesKnife Plugin Usageknife <cloudname> server delete• Chef Node Name• Purge ...
http://www.clogeny.com© 2012 Clogeny TechnologiesHigh Level Diagram...knife-ec2knife-rackspaceKnife-vcloud….AWS DriverRack...
http://www.clogeny.com© 2012 Clogeny TechnologiesHigh Level Diagram...knife-ec2knife-rackspaceKnife-vcloud….AWS DriverRack...
http://www.clogeny.com© 2012 Clogeny Technologiesfog.ioKnife Cloud plugins use fog to communicate with theCloud services
http://www.clogeny.com© 2012 Clogeny TechnologiesFogFog - Multi-Cloud Services LibraryOpen source, Community drivenPortabl...
http://www.clogeny.com© 2012 Clogeny TechnologiesUsing Fog$ gem install fogFetching: fog-1.10.1.gem (100%)Successfully ins...
http://www.clogeny.com© 2012 Clogeny TechnologiesUsing Fog Interactive$ fogWelcome to fog interactive!>> connection = Fog:...
http://www.clogeny.com© 2012 Clogeny TechnologiesUsing Fog Interactive$ fogWelcome to fog interactive!>> connection = Fog:...
http://www.clogeny.com© 2012 Clogeny TechnologiesUsing Fog Interactive$ fogWelcome to fog interactive!>> connection = Fog:...
http://www.clogeny.com© 2012 Clogeny TechnologiesUsing Fog Interactive$ fogWelcome to fog interactive!>> connection = Fog:...
http://www.clogeny.com© 2012 Clogeny TechnologiesHigh Level Diagram...knife-ec2knife-rackspaceKnife-vcloud….AWS DriverRack...
http://www.clogeny.com© 2012 Clogeny TechnologiesKnife plugin – Fog collectionsknife-cloudknife cloud server createknife c...
http://www.clogeny.com© 2012 Clogeny TechnologiesKnife plugin – Fog collectionsknife-cloudknife cloud server createknife c...
http://www.clogeny.com© 2012 Clogeny Technologiesknife cloud server createclass Chefclass Knifeclass CloudServerCreate < K...
http://www.clogeny.com© 2012 Clogeny Technologiesknife cloud server createclass Chefclass Knifeclass CloudServerCreate < K...
http://www.clogeny.com© 2012 Clogeny Technologiesknife cloud server createclass Chefclass Knifeclass CloudServerCreate < K...
http://www.clogeny.com© 2012 Clogeny Technologiesknife cloud server createclass Chefclass Knifeclass CloudServerCreate < K...
http://www.clogeny.com© 2012 Clogeny Technologiesknife cloud server create (run)def run- validate compulsory parameters….c...
http://www.clogeny.com© 2012 Clogeny Technologiesknife cloud server create (run)def run- validate compulsory parameters….c...
http://www.clogeny.com© 2012 Clogeny Technologiesknife cloud server create (run)def run- validate compulsory parameters….c...
http://www.clogeny.com© 2012 Clogeny Technologiesknife cloud server create (run)def run- validate compulsory parameters….c...
http://www.clogeny.com© 2012 Clogeny Technologiesknife cloud server create (run)def run- validate compulsory parameters….c...
http://www.clogeny.com© 2012 Clogeny Technologiesknife cloud server create (run)def run- validate compulsory parameters….c...
http://www.clogeny.com© 2012 Clogeny TechnologiesBootstrappingInstalls Chef and runs thechef-client tocommunicate with a C...
http://www.clogeny.com© 2012 Clogeny TechnologiesKnife plugin – Fog collectionsknife-cloudknife cloud server createknife c...
http://www.clogeny.com© 2012 Clogeny Technologiesknife cloud server deleteclass Chefclass Knifeclass CloudServerDelete < K...
http://www.clogeny.com© 2012 Clogeny TechnologiesKnife plugin – Fog collectionsknife-cloudknife cloud server createknife c...
http://www.clogeny.com© 2012 Clogeny Technologiesknife cloud image listclass Chefclass Knifeclass CloudImageList < Knifeba...
http://www.clogeny.com© 2012 Clogeny TechnologiesKnife plugin – Fog collectionsknife-cloudknife cloud server createknife c...
http://www.clogeny.com© 2012 Clogeny Technologiesknife plugin directory structureknife-vcloud├── Gemfile├── knife-vcloud.g...
http://www.clogeny.com© 2012 Clogeny Technologiesknife plugin directory structureknife-vcloud├── Gemfile├── knife-vcloud.g...
http://www.clogeny.com© 2012 Clogeny Technologiesknife plugin directory structureknife-vcloud├── Gemfile├── knife-vcloud.g...
http://www.clogeny.com© 2012 Clogeny Technologiesknife plugin directory structureknife-vcloud├── Gemfile├── knife-vcloud.g...
http://www.clogeny.com© 2012 Clogeny Technologiesknife plugin directory structureknife-vcloud├── Gemfile├── knife-vcloud.g...
VMWare vCloud Director
http://www.clogeny.com© 2012 Clogeny TechnologiesVMWare vCloud DirectorReference: http://www.vmguru.nl/wordpress/2012/01/v...
http://www.clogeny.com© 2012 Clogeny TechnologiesvAppsContainer of one ormore VMs• Package up Multi-tierApplications into ...
http://www.clogeny.com© 2012 Clogeny TechnologiesCatalogsCatalogs are collections of vApps, vAppsTemplates and mediaExampl...
http://www.clogeny.com© 2012 Clogeny TechnologiesvCloud Layered NetworkExternal NetworkOrganization NetworkvApp NetworkExt...
http://www.clogeny.com© 2012 Clogeny Technologiesknife-vcloudGit repo: https://github.com/opscode/knife-vcloudSupport to p...
http://www.clogeny.com© 2012 Clogeny Technologiesknife-vcloudGit repo: https://github.com/opscode/knife-vcloudSupport to p...
http://www.clogeny.com© 2012 Clogeny TechnologiesDeploying a vAppRef: http://hol-prt.cloudfoundry.com/HOL-PRT-04_EN/HOL-PR...
http://www.clogeny.com© 2012 Clogeny TechnologiesDeploying a vAppRef: http://hol-prt.cloudfoundry.com/HOL-PRT-04_EN/HOL-PR...
http://www.clogeny.com© 2012 Clogeny TechnologiesDeploying a vAppRef: http://hol-prt.cloudfoundry.com/HOL-PRT-04_EN/HOL-PR...
http://www.clogeny.com© 2012 Clogeny TechnologiesDeploying a vAppSelect the vApp Template.Select the NetworkProvide a name...
http://www.clogeny.com© 2012 Clogeny TechnologiesDeploying a vAppSelect the vApp Template.Select the NetworkProvide a name...
http://www.clogeny.com© 2012 Clogeny TechnologiesDeploying a vApp(Deep-Dive)Select the vApp Template.
http://www.clogeny.com© 2012 Clogeny TechnologiesDeploying a vApp(Deep-Dive)Select the vApp Template.
http://www.clogeny.com© 2012 Clogeny TechnologiesDeploying a vApp(Deep-Dive)Select the vApp Template.
http://www.clogeny.com© 2012 Clogeny TechnologiesDeploying a vApp(Deep-Dive)Select the vApp Template.
http://www.clogeny.com© 2012 Clogeny TechnologiesDeploying a vApp(Deep-Dive)Select the vApp Template.
http://www.clogeny.com© 2012 Clogeny TechnologiesDeploying a vApp (Deep-Dive)Select the vApp Template.Select the Network
http://www.clogeny.com© 2012 Clogeny TechnologiesDeploying a vApp (Deep-Dive)Select the vApp Template.Select the Network
http://www.clogeny.com© 2012 Clogeny TechnologiesDeploying a vApp (Deep-Dive)Select the vApp Template.Select the Network
http://www.clogeny.com© 2012 Clogeny TechnologiesDeploying a vApp (Deep-Dive)Select the vApp Template.Select the NetworkBu...
http://www.clogeny.com© 2012 Clogeny TechnologiesDeploying a vApp (Deep-Dive)Select the vApp Template.Select the NetworkBu...
http://www.clogeny.com© 2012 Clogeny TechnologiesDeploying a vApp (Deep-Dive)Select the vApp Template.Select the NetworkBu...
http://www.clogeny.com© 2012 Clogeny TechnologiesDeploying a vApp (Deep-Dive)Select the vApp Template.Select the NetworkBu...
http://www.clogeny.com© 2012 Clogeny TechnologiesDeploying a vApp (Deep-Dive)Additional Configuration
http://www.clogeny.com© 2012 Clogeny TechnologiesDeploying a vApp (Deep-Dive)Additional Configuration
http://www.clogeny.com© 2012 Clogeny TechnologiesDeploying a vApp (Deep-Dive)Additional Configuration
http://www.clogeny.com© 2012 Clogeny TechnologiesDeploying a vApp (Deep-Dive)Additional Configuration
http://www.clogeny.com© 2012 Clogeny TechnologiesDeploying a vApp (Deep-Dive)Additional Configuration
http://www.clogeny.com© 2012 Clogeny TechnologiesDeploying a vApp (Deep-Dive)Save Additional Configuration
http://www.clogeny.com© 2012 Clogeny TechnologiesDeploying a vApp (Deep-Dive)Power On!
http://www.clogeny.com© 2012 Clogeny TechnologiesDeploying a vApp (Deep-Dive)Wait until ready
http://www.clogeny.com© 2012 Clogeny TechnologiesDeploying a vApp (Deep-Dive)Linux Bootstrapping!
http://www.clogeny.com© 2012 Clogeny TechnologiesDeploying a vApp (Deep-Dive)Linux Bootstrapping!
http://www.clogeny.com© 2012 Clogeny TechnologiesDeploying a vApp (Deep-Dive)Linux Bootstrapping!
http://www.clogeny.com© 2012 Clogeny TechnologiesDeploying a vApp (Deep-Dive)Windows Bootstrapping!
http://www.clogeny.com© 2012 Clogeny TechnologiesDeploying a vApp (Deep-Dive)Windows Bootstrapping!
http://www.clogeny.com© 2012 Clogeny Technologiesknife vcloud server create (Linux)knife vcloud server create--image <vApp...
http://www.clogeny.com© 2012 Clogeny Technologiesknife vcloud server create (Windows)knife vcloud server create--image <vA...
http://www.clogeny.com© 2012 Clogeny TechnologiesDemo
http://www.clogeny.com© 2012 Clogeny Technologiesknife vcloud server createSource Code: https://github.com/opscode/knife-v...
http://www.clogeny.com© 2012 Clogeny Technologiesknife vcloud server deleteIdentify the vApp to deletePower Off the vAppDe...
http://www.clogeny.com© 2012 Clogeny Technologiesknife vcloud server deleteIdentify the vApp to deletePower Off the vAppDe...
http://www.clogeny.com© 2012 Clogeny TechnologiesResource Listing• knife vcloud server list• knife vcloud image list• Knif...
http://www.clogeny.com© 2012 Clogeny Technologiesknife vcloud server list
http://www.clogeny.com© 2012 Clogeny Technologiesknife vcloud image list
http://www.clogeny.com© 2012 Clogeny Technologiesknife vcloud network list
http://www.clogeny.com© 2012 Clogeny TechnologiesDemo
http://www.clogeny.com© 2012 Clogeny TechnologiesChefs: now with Knife expertise!Ref: http://s3.hubimg.com/u/1691762_f520....
Thank You!Innovation → Execution → Solution → DeliveredFeel free to reach out :Email: chirag@clogeny.comTwitter: @cheezo
Upcoming SlideShare
Loading in …5
×

ChefConf 2013 Talk: Writing a Knife cloud plugin for your shiny VMWare vCloud Director

9,529 views
9,514 views

Published on

Knife cloud plugins extend Knife's behaviour to easily manage servers(nodes) in the public or private cloud using Chef. vCloud Director(vCD) is the flagship cloud provisioning product from VMWare which power several public clouds like Bluelock, AT&T, Dell etc as well as private clouds. The aim of this session is to help developers understand knife cloud plugin framework, cover the basics of VMWare vCloud Director and how they can extend the existing knife vcloud plugin or write new plugins to manage their own vCD-based cloud. The sesion cover the following topics:

Understanding the Knife cloud plugin framework
Dissecting a Knife cloud plugin with a code walkthrough
Understanding Windows bootstrapping
What is fog and how to use it effectively ?
Basics of VMWare vCloud Director API Model- compute, storage and networking with real-life examples
Demo of the knife vcloud plugins for Bluelock, Dell and private clouds.
Best Practices for writing knife plugins

0 Comments
4 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
9,529
On SlideShare
0
From Embeds
0
Number of Embeds
6,058
Actions
Shares
0
Downloads
40
Comments
0
Likes
4
Embeds 0
No embeds

No notes for slide

ChefConf 2013 Talk: Writing a Knife cloud plugin for your shiny VMWare vCloud Director

  1. 1. Writing a Knife Plugin for yourshiny new VMWare vCloudDirectorChirag Jog, CTO Clogenychirag@clogeny.comInnovation → Execution → Solution → Delivered
  2. 2. http://www.clogeny.com© 2012 Clogeny TechnologiesAbout MeBuilt cutting edgeproducts:• Hybrid Cloud MigrationAppliances• Enterprise Java PaaS• Multi-cloud single pane ofglass DashboardContributed to severalknife plugins• VMWare vCloud Director• Google Compute Engine• Windows Azure• Citrix Cloudstack• Terremark• Amazon EC2Co-founder/CTO at Clogeny
  3. 3. http://www.clogeny.com© 2012 Clogeny TechnologiesAgenda What is the knife plugins ? The Knife cloud plugin framework VMWare vCloud Director API Model Code Walkthrough of the knife-vcloud plugin Demo of the knife vcloud plugin
  4. 4. http://www.clogeny.com© 2012 Clogeny TechnologiesWhat are knife cloud plugins ?Extend Knife to support additional functionality Virtual Machine Life cycle Server Create Linux and Windows Bootstrapping Server Destroy List available cloud resources Images Flavors / Server Types Networks Servers
  5. 5. http://www.clogeny.com© 2012 Clogeny TechnologiesAvailable Cloud Plugins
  6. 6. http://www.clogeny.com© 2012 Clogeny TechnologiesKnife Plugin Usagegem install knife-<cloudname>
  7. 7. http://www.clogeny.com© 2012 Clogeny TechnologiesKnife Plugin Usagegem install knife-<cloudname>knife <cloudname> server create
  8. 8. http://www.clogeny.com© 2012 Clogeny TechnologiesKnife Plugin Usagegem install knife-<cloudname>knife <cloudname> server create• Flavor or Server size• Image• Zone/Region• Template/Distro• Chef Node Name• SSH params – sshusername, password, keypair, keypair file• WinRM params – username, password, AD/Kerberosparams• Cloud Vendor Credentials
  9. 9. http://www.clogeny.com© 2012 Clogeny TechnologiesKnife Plugin Usageknife <cloudname> server delete• Chef Node Name• Purge Node/Clientknife <cloudname> server listknife <cloudname> image listknife <cloudname> flavor list
  10. 10. http://www.clogeny.com© 2012 Clogeny TechnologiesHigh Level Diagram...knife-ec2knife-rackspaceKnife-vcloud….AWS DriverRackspaceDriverFog libraryvCloud Driver
  11. 11. http://www.clogeny.com© 2012 Clogeny TechnologiesHigh Level Diagram...knife-ec2knife-rackspaceKnife-vcloud….AWS DriverRackspaceDriverFog libraryvCloud Driver
  12. 12. http://www.clogeny.com© 2012 Clogeny Technologiesfog.ioKnife Cloud plugins use fog to communicate with theCloud services
  13. 13. http://www.clogeny.com© 2012 Clogeny TechnologiesFogFog - Multi-Cloud Services LibraryOpen source, Community drivenPortable, Powerful, EstablishedSimulated Fog behavior using MockOrganizes resources –servers, images, networks, vapps as collection ofmodels.
  14. 14. http://www.clogeny.com© 2012 Clogeny TechnologiesUsing Fog$ gem install fogFetching: fog-1.10.1.gem (100%)Successfully installed fog-1.10.11 gem installed
  15. 15. http://www.clogeny.com© 2012 Clogeny TechnologiesUsing Fog Interactive$ fogWelcome to fog interactive!>> connection = Fog::Compute.new(:provider => <CloudProvider>, credential params..)>> images = connection.images.all[<Fog::Compute::Cloud::Image id=…, name=“ubuntu”>,<Fog::Compute::Cloud::Image id=…, name=“centos”>…]>> servers = connection.servers.all>> server =connection.servers.create(server_def_params)
  16. 16. http://www.clogeny.com© 2012 Clogeny TechnologiesUsing Fog Interactive$ fogWelcome to fog interactive!>> connection = Fog::Compute.new(:provider => <CloudProvider>, credential params..)>> images = connection.images.all[<Fog::Compute::Cloud::Image id=…, name=“ubuntu”>,<Fog::Compute::Cloud::Image id=…, name=“centos”>…]>> servers = connection.servers.all>> server =connection.servers.create(server_def_params)
  17. 17. http://www.clogeny.com© 2012 Clogeny TechnologiesUsing Fog Interactive$ fogWelcome to fog interactive!>> connection = Fog::Compute.new(:provider => <CloudProvider>, credential params..)>> images = connection.images.all[<Fog::Compute::Cloud::Image id=…, name=“ubuntu”>,<Fog::Compute::Cloud::Image id=…, name=“centos”>…]>> servers = connection.servers.all>> server = connection.servers.create(server_def_params)
  18. 18. http://www.clogeny.com© 2012 Clogeny TechnologiesUsing Fog Interactive$ fogWelcome to fog interactive!>> connection = Fog::Compute.new(:provider => <CloudProvider>, credential params..)>> images = connection.images.all[<Fog::Compute::Cloud::Image id=…, name=“ubuntu”>,<Fog::Compute::Cloud::Image id=…, name=“centos”>…]>> servers = connection.servers.all>> server = connection.servers.create(server_def_params)
  19. 19. http://www.clogeny.com© 2012 Clogeny TechnologiesHigh Level Diagram...knife-ec2knife-rackspaceKnife-vcloud….AWS DriverRackspaceDriverFog libraryvCloud Driver
  20. 20. http://www.clogeny.com© 2012 Clogeny TechnologiesKnife plugin – Fog collectionsknife-cloudknife cloud server createknife cloud server deleteknife cloud server listknife cloud flavor listknife cloud image listserversimagesflavorsFogCollections
  21. 21. http://www.clogeny.com© 2012 Clogeny TechnologiesKnife plugin – Fog collectionsknife-cloudknife cloud server createknife cloud server deleteknife cloud server listknife cloud flavor listknife cloud image listserversimagesflavorsFogCollections
  22. 22. http://www.clogeny.com© 2012 Clogeny Technologiesknife cloud server createclass Chefclass Knifeclass CloudServerCreate < Knifebanner "knife vcloud server create (options)”option :flavor,:short => "-f FLAVOR_ID",:long => "--flavor FLAVOR_ID",:description => "The flavor ID of server (m1.small, m1.medium, etc)",:proc => Proc.new { |f| Chef::Config[:knife][:flavor] = f }option :image,:short => "-I IMAGE_ID",:long => "--image IMAGE_ID",:description => "The image ID for the server",:proc => Proc.new { |i| Chef::Config[:knife][:image] = i }option :chef_node_name….option :zone…Several bootstrapping options
  23. 23. http://www.clogeny.com© 2012 Clogeny Technologiesknife cloud server createclass Chefclass Knifeclass CloudServerCreate < Knifebanner "knife vcloud server create (options)”option :flavor,:short => "-f FLAVOR_ID",:long => "--flavor FLAVOR_ID",:description => "The flavor ID of server(m1.small, m1.medium, etc)",:proc => Proc.new { |f| Chef::Config[:knife][:flavor] = f }option :image,:short => "-I IMAGE_ID",:long => "--image IMAGE_ID",:description => "The image ID for the server",:proc => Proc.new { |i| Chef::Config[:knife][:image] = i }option :chef_node_name….option :zone…Several bootstrapping optionsInherit from theChef::Knife class
  24. 24. http://www.clogeny.com© 2012 Clogeny Technologiesknife cloud server createclass Chefclass Knifeclass CloudServerCreate < Knifebanner "knife vcloud server create (options)”option :flavor,:short => "-f FLAVOR_ID",:long => "--flavor FLAVOR_ID",:description => "The flavor ID of server(m1.small, m1.medium, etc)",:proc => Proc.new { |f| Chef::Config[:knife][:flavor] = f }option :image,:short => "-I IMAGE_ID",:long => "--image IMAGE_ID",:description => "The image ID for the server",:proc => Proc.new { |i| Chef::Config[:knife][:image] = i }option :chef_node_name….option :zone…Several bootstrapping optionsUsage BannerInherit from theChef::Knife class
  25. 25. http://www.clogeny.com© 2012 Clogeny Technologiesknife cloud server createclass Chefclass Knifeclass CloudServerCreate < Knifebanner "knife vcloud server create (options)”option :flavor,:short => "-f FLAVOR_ID",:long => "--flavor FLAVOR_ID",:description => "The flavor ID of server(m1.small, m1.medium, etc)",:proc => Proc.new { |f| Chef::Config[:knife][:flavor] = f }option :image,:short => "-I IMAGE_ID",:long => "--image IMAGE_ID",:description => "The image ID for the server",:proc => Proc.new { |i| Chef::Config[:knife][:image] = i }option :chef_node_name….option :zone…Several bootstrapping optionsParameter Optionslike Serversize, Image, Zoneand BootstrappingOptionsUsage BannerInherit from theChef::Knife class
  26. 26. http://www.clogeny.com© 2012 Clogeny Technologiesknife cloud server create (run)def run- validate compulsory parameters….connection = Fog::Compute.new(…)…Cloud provider based checks…server = connection.servers.create(params)…Cloud provider specific logic –Enable Networking,Associate IP Address,Reconfigure Server…if windows_image?wait_for_winrmelsewait_for_sshdend// Server is now up and runningBootstrap the Nodeend
  27. 27. http://www.clogeny.com© 2012 Clogeny Technologiesknife cloud server create (run)def run- validate compulsory parameters….connection = Fog::Compute.new(…)…Cloud provider based checks…server = connection.servers.create(params)…Cloud provider specific logic –Enable Networking,Associate IP Address,Reconfigure Server…if windows_image?wait_for_winrmelsewait_for_sshdend// Server is now up and runningBootstrap the NodeendKnife commands are run bycalling the `#run` method onan instance of your commandclass
  28. 28. http://www.clogeny.com© 2012 Clogeny Technologiesknife cloud server create (run)def run- validate compulsory parameters….connection = Fog::Compute.new(…)…Cloud provider based checks…server = connection.servers.create(params)…Cloud provider specific logic –Enable Networking,Associate IP Address,Reconfigure Server…if windows_image?wait_for_winrmelsewait_for_sshdend// Server is now up and runningBootstrap the NodeendKnife commands are run bycalling the `#run` method onan instance of your commandclassCreate the fog connectionobject
  29. 29. http://www.clogeny.com© 2012 Clogeny Technologiesknife cloud server create (run)def run- validate compulsory parameters….connection = Fog::Compute.new(…)…Cloud provider based checks…server = connection.servers.create(params)…Cloud provider specific logic –Enable Networking,Associate IP Address,Reconfigure Server…if windows_image?wait_for_winrmelsewait_for_sshdend// Server is now up and runningBootstrap the NodeendKnife commands are run bycalling the `#run` method onan instance of your commandclassCreate the fog connectionobjectCreate and configure theserver
  30. 30. http://www.clogeny.com© 2012 Clogeny Technologiesknife cloud server create (run)def run- validate compulsory parameters….connection = Fog::Compute.new(…)…Cloud provider based checks…server = connection.servers.create(params)…Cloud provider specific logic –Enable Networking,Associate IP Address,Reconfigure Server…if windows_image?wait_for_winrmelsewait_for_sshdend// Server is now up and runningBootstrap the NodeendKnife commands are run bycalling the `#run` method onan instance of your commandclassCreate the fog connectionobjectCreate and configure theserverWait for WinRM/SSH Serviceto start
  31. 31. http://www.clogeny.com© 2012 Clogeny Technologiesknife cloud server create (run)def run- validate compulsory parameters….connection = Fog::Compute.new(…)…Cloud provider based checks…server = connection.servers.create(params)…Cloud provider specific logic –Enable Networking,Associate IP Address,Reconfigure Server…if windows_image?wait_for_winrmelsewait_for_sshdend// Server is now up and runningBootstrap the NodeendKnife commands are run bycalling the `#run` method onan instance of your commandclassCreate the fog connectionobjectCreate and configure theserverWait for WinRM/SSH Serviceto startWindows or LinuxBootstrapping
  32. 32. http://www.clogeny.com© 2012 Clogeny TechnologiesBootstrappingInstalls Chef and runs thechef-client tocommunicate with a ChefServer• via SSH• via Windows RemoteManagement(WinRM)Ref: http://www.lemen.com/imageBootstrap1.html
  33. 33. http://www.clogeny.com© 2012 Clogeny TechnologiesKnife plugin – Fog collectionsknife-cloudknife cloud server createknife cloud server deleteknife cloud server listknife cloud flavor listknife cloud image listserversimagesflavorsFogCollections
  34. 34. http://www.clogeny.com© 2012 Clogeny Technologiesknife cloud server deleteclass Chefclass Knifeclass CloudServerDelete < Knifebanner "knife vcloud server delete (options)”def runvalidate compulsory parameters….connection = Fog::Compute.new(…)Check whether server(s) exists or not@name_args.each do |server_id|beginserver = connection.servers.get(server_id)if !serverui.warn(“Server does not exists”)nextendconfirm("Do you really want to delete this server”)server.destroyui.warn("Deleted server #{server.id}")#Destroy Chef Node# Destroy Chef ClientendInherit from theChef::Knife classUsage BannerFind the Server andDelete it
  35. 35. http://www.clogeny.com© 2012 Clogeny TechnologiesKnife plugin – Fog collectionsknife-cloudknife cloud server createknife cloud server deleteknife cloud server listknife cloud flavor listknife cloud image listserversimagesflavorsFogCollections
  36. 36. http://www.clogeny.com© 2012 Clogeny Technologiesknife cloud image listclass Chefclass Knifeclass CloudImageList < Knifebanner "knife cloud image list (options)"def runimage_list = [ui.color(ID, :bold),ui.color(Name, :bold)]connection.images.sort_by(&:name).each do |image|image_list << image.id.to_simage_list << image.nameendputs ui.list(image_list, :uneven_columns_across, 2)endendendendInherit from theChef::Knife classUsage BannerList Resource andDisplay it
  37. 37. http://www.clogeny.com© 2012 Clogeny TechnologiesKnife plugin – Fog collectionsknife-cloudknife cloud server createknife cloud server deleteknife cloud server listknife cloud flavor listknife cloud image listserversimagesflavorsFogCollections
  38. 38. http://www.clogeny.com© 2012 Clogeny Technologiesknife plugin directory structureknife-vcloud├── Gemfile├── knife-vcloud.gemspec├── lib├ chef├ knife-vcloud├ version.rb├ knife├ vcloud_server_create.rb├ vcloud_server_delete.rb├ vcloud_image_list.rb├── spec├── README.md└── LICENSE
  39. 39. http://www.clogeny.com© 2012 Clogeny Technologiesknife plugin directory structureknife-vcloud├── Gemfile├── knife-vcloud.gemspec├── lib├ chef├ knife-vcloud├ version.rb├ knife├ vcloud_server_create.rb├ vcloud_server_delete.rb├ vcloud_image_list.rb├── spec├── README.md└── LICENSEParent Directory
  40. 40. http://www.clogeny.com© 2012 Clogeny Technologiesknife plugin directory structureknife-vcloud├── Gemfile├── knife-vcloud.gemspec├── lib├ chef├ knife-vcloud├ version.rb├ knife├ vcloud_server_create.rb├ vcloud_server_delete.rb├ vcloud_image_list.rb├── spec├── README.md└── LICENSERequired to buildthe gemParent Directory
  41. 41. http://www.clogeny.com© 2012 Clogeny Technologiesknife plugin directory structureknife-vcloud├── Gemfile├── knife-vcloud.gemspec├── lib├ chef├ knife-vcloud├ version.rb├ knife├ vcloud_server_create.rb├ vcloud_server_delete.rb├ vcloud_image_list.rb├── spec├── README.md└── LICENSEVersion InfoRequired to buildthe gemParent Directory
  42. 42. http://www.clogeny.com© 2012 Clogeny Technologiesknife plugin directory structureknife-vcloud├── Gemfile├── knife-vcloud.gemspec├── lib├ chef├ knife-vcloud├ version.rb├ knife├ vcloud_server_create.rb├ vcloud_server_delete.rb├ vcloud_image_list.rb├── spec├── README.md└── LICENSEActual CodeVersion InfoRequired to buildthe gemParent Directory
  43. 43. VMWare vCloud Director
  44. 44. http://www.clogeny.com© 2012 Clogeny TechnologiesVMWare vCloud DirectorReference: http://www.vmguru.nl/wordpress/2012/01/vmware-vcloud-director-design-guidelines/
  45. 45. http://www.clogeny.com© 2012 Clogeny TechnologiesvAppsContainer of one ormore VMs• Package up Multi-tierApplications into vApps• Operate on VMs as oneunit• Can be created byscratch• Can be imported fromoutside the cloudReference: http://download3.vmware.com/vcat/documentation-center/index.html#page/Consuming%20a%20vCloud/3c%20Consuming%20a%20VMware%20vCloud.2.077.html
  46. 46. http://www.clogeny.com© 2012 Clogeny TechnologiesCatalogsCatalogs are collections of vApps, vAppsTemplates and mediaExamples:• Infrastructure as Service Catalogs• Pre-installed Windows/Linux VMs• OS Media files• App Catalogs
  47. 47. http://www.clogeny.com© 2012 Clogeny TechnologiesvCloud Layered NetworkExternal NetworkOrganization NetworkvApp NetworkExternal Network : Providing a connection to the outside worldOrganization Network : Network contained within an organizationvApp Network : Network contained within a vAppRef: http://hol-prt.cloudfoundry.com/HOL-PRT-04_EN/HOL-PRT-04-m1/lessons/vCloud_Director_networking_and_Cisco_Nexus_1000V.html
  48. 48. http://www.clogeny.com© 2012 Clogeny Technologiesknife-vcloudGit repo: https://github.com/opscode/knife-vcloudSupport to provision one-VM vApps onto the Org-level networkSupported Commands:• knife vcloud server create• knife vcloud server list• knife vcloud server delete• knife vcloud image list• knife vcloud network list
  49. 49. http://www.clogeny.com© 2012 Clogeny Technologiesknife-vcloudGit repo: https://github.com/opscode/knife-vcloudSupport to provision one-VM vApps onto the Org-level networkSupported Commands:• knife vcloud server create• knife vcloud server list• knife vcloud server delete• knife vcloud image list• knife vcloud network listLets focus on it!
  50. 50. http://www.clogeny.com© 2012 Clogeny TechnologiesDeploying a vAppRef: http://hol-prt.cloudfoundry.com/HOL-PRT-04_EN/HOL-PRT-04-m1/lessons/vCloud_Director_networking_and_Cisco_Nexus_1000V.htmlSelect the vApp Template.
  51. 51. http://www.clogeny.com© 2012 Clogeny TechnologiesDeploying a vAppRef: http://hol-prt.cloudfoundry.com/HOL-PRT-04_EN/HOL-PRT-04-m1/lessons/vCloud_Director_networking_and_Cisco_Nexus_1000V.htmlSelect the vApp Template.Select the Network
  52. 52. http://www.clogeny.com© 2012 Clogeny TechnologiesDeploying a vAppRef: http://hol-prt.cloudfoundry.com/HOL-PRT-04_EN/HOL-PRT-04-m1/lessons/vCloud_Director_networking_and_Cisco_Nexus_1000V.htmlSelect the vApp Template.Select the NetworkProvide a name, administrator Password to thevApp being deployed.
  53. 53. http://www.clogeny.com© 2012 Clogeny TechnologiesDeploying a vAppSelect the vApp Template.Select the NetworkProvide a name, administrator Password to thevApp being deployed.Configure the virtual machines inside thevApp, including• computer name,• CPU and Memory• Network and IP Assignment.
  54. 54. http://www.clogeny.com© 2012 Clogeny TechnologiesDeploying a vAppSelect the vApp Template.Select the NetworkProvide a name, administrator Password to thevApp being deployed.Configure the virtual machines inside thevApp, including• computer name,• CPU and Memory• Network and IP Assignment.Bootstrapping!
  55. 55. http://www.clogeny.com© 2012 Clogeny TechnologiesDeploying a vApp(Deep-Dive)Select the vApp Template.
  56. 56. http://www.clogeny.com© 2012 Clogeny TechnologiesDeploying a vApp(Deep-Dive)Select the vApp Template.
  57. 57. http://www.clogeny.com© 2012 Clogeny TechnologiesDeploying a vApp(Deep-Dive)Select the vApp Template.
  58. 58. http://www.clogeny.com© 2012 Clogeny TechnologiesDeploying a vApp(Deep-Dive)Select the vApp Template.
  59. 59. http://www.clogeny.com© 2012 Clogeny TechnologiesDeploying a vApp(Deep-Dive)Select the vApp Template.
  60. 60. http://www.clogeny.com© 2012 Clogeny TechnologiesDeploying a vApp (Deep-Dive)Select the vApp Template.Select the Network
  61. 61. http://www.clogeny.com© 2012 Clogeny TechnologiesDeploying a vApp (Deep-Dive)Select the vApp Template.Select the Network
  62. 62. http://www.clogeny.com© 2012 Clogeny TechnologiesDeploying a vApp (Deep-Dive)Select the vApp Template.Select the Network
  63. 63. http://www.clogeny.com© 2012 Clogeny TechnologiesDeploying a vApp (Deep-Dive)Select the vApp Template.Select the NetworkBuild the server spec and deploy the vApp
  64. 64. http://www.clogeny.com© 2012 Clogeny TechnologiesDeploying a vApp (Deep-Dive)Select the vApp Template.Select the NetworkBuild the server spec and deploy the vApp
  65. 65. http://www.clogeny.com© 2012 Clogeny TechnologiesDeploying a vApp (Deep-Dive)Select the vApp Template.Select the NetworkBuild the server spec and deploy the vApp
  66. 66. http://www.clogeny.com© 2012 Clogeny TechnologiesDeploying a vApp (Deep-Dive)Select the vApp Template.Select the NetworkBuild the server spec and deploy the vApp
  67. 67. http://www.clogeny.com© 2012 Clogeny TechnologiesDeploying a vApp (Deep-Dive)Additional Configuration
  68. 68. http://www.clogeny.com© 2012 Clogeny TechnologiesDeploying a vApp (Deep-Dive)Additional Configuration
  69. 69. http://www.clogeny.com© 2012 Clogeny TechnologiesDeploying a vApp (Deep-Dive)Additional Configuration
  70. 70. http://www.clogeny.com© 2012 Clogeny TechnologiesDeploying a vApp (Deep-Dive)Additional Configuration
  71. 71. http://www.clogeny.com© 2012 Clogeny TechnologiesDeploying a vApp (Deep-Dive)Additional Configuration
  72. 72. http://www.clogeny.com© 2012 Clogeny TechnologiesDeploying a vApp (Deep-Dive)Save Additional Configuration
  73. 73. http://www.clogeny.com© 2012 Clogeny TechnologiesDeploying a vApp (Deep-Dive)Power On!
  74. 74. http://www.clogeny.com© 2012 Clogeny TechnologiesDeploying a vApp (Deep-Dive)Wait until ready
  75. 75. http://www.clogeny.com© 2012 Clogeny TechnologiesDeploying a vApp (Deep-Dive)Linux Bootstrapping!
  76. 76. http://www.clogeny.com© 2012 Clogeny TechnologiesDeploying a vApp (Deep-Dive)Linux Bootstrapping!
  77. 77. http://www.clogeny.com© 2012 Clogeny TechnologiesDeploying a vApp (Deep-Dive)Linux Bootstrapping!
  78. 78. http://www.clogeny.com© 2012 Clogeny TechnologiesDeploying a vApp (Deep-Dive)Windows Bootstrapping!
  79. 79. http://www.clogeny.com© 2012 Clogeny TechnologiesDeploying a vApp (Deep-Dive)Windows Bootstrapping!
  80. 80. http://www.clogeny.com© 2012 Clogeny Technologiesknife vcloud server create (Linux)knife vcloud server create--image <vApp-Linux-template ID>--node-name linux_node_test--network <Network ID>--ssh-user <SSH Username>--ssh-password <SSH Password>--distro chef-full
  81. 81. http://www.clogeny.com© 2012 Clogeny Technologiesknife vcloud server create (Windows)knife vcloud server create--image <vApp-Windows-template ID>--node-name windows_node_test--network <Network ID>--bootstrap-protocol winrm--winrm-password <Windows WinRM Password>--template-file ../knife-windows/lib/chef/knife/bootstrap/windows-chef-client-msi.erb-VV
  82. 82. http://www.clogeny.com© 2012 Clogeny TechnologiesDemo
  83. 83. http://www.clogeny.com© 2012 Clogeny Technologiesknife vcloud server createSource Code: https://github.com/opscode/knife-vcloud/blob/master/lib/chef/knife/vcloud_server_create.rb
  84. 84. http://www.clogeny.com© 2012 Clogeny Technologiesknife vcloud server deleteIdentify the vApp to deletePower Off the vAppDelete the vApp
  85. 85. http://www.clogeny.com© 2012 Clogeny Technologiesknife vcloud server deleteIdentify the vApp to deletePower Off the vAppDelete the vApp
  86. 86. http://www.clogeny.com© 2012 Clogeny TechnologiesResource Listing• knife vcloud server list• knife vcloud image list• Knife vcloud network list
  87. 87. http://www.clogeny.com© 2012 Clogeny Technologiesknife vcloud server list
  88. 88. http://www.clogeny.com© 2012 Clogeny Technologiesknife vcloud image list
  89. 89. http://www.clogeny.com© 2012 Clogeny Technologiesknife vcloud network list
  90. 90. http://www.clogeny.com© 2012 Clogeny TechnologiesDemo
  91. 91. http://www.clogeny.com© 2012 Clogeny TechnologiesChefs: now with Knife expertise!Ref: http://s3.hubimg.com/u/1691762_f520.jpg
  92. 92. Thank You!Innovation → Execution → Solution → DeliveredFeel free to reach out :Email: chirag@clogeny.comTwitter: @cheezo

×