SlideShare ist ein Scribd-Unternehmen logo
1 von 37
Downloaden Sie, um offline zu lesen
Developing OpenStack
Tooling
...without Python
Colleen Murphy, HP
The problem
We need to manage OpenStack resources with
puppet
Lightning intro to puppet
● resource - something being managed on a
system
● type - the interface of the resource
● provider - the backend implementation of the
resource
Example: file
file { '/root/example':
ensure => present,
content => 'A file resource managed by puppet',
mode => '0644',
}
Example: mysql_database
mysql_database { 'keystone':
ensure => present,
charset => 'utf8',
collate => 'utf8_general_ci',
}
Example: mysql_database
# puppet apply mysql.pp --debug
Debug: Prefetching mysql resources for mysql_database
Debug: Executing '/usr/bin/mysql --defaults-extra-file=/root/.my.cnf
-NBe show databases'
Debug: Executing '/usr/bin/mysql --defaults-extra-file=/root/.my.cnf
-NBe create database if not exists `keystone` character set `utf8`
collate `utf8_general_ci`'
Notice: /Stage[main]/Main/Mysql_database[keystone]/ensure: created
#
Example: keystone_tenant
keystone_tenant { 'services':
ensure => present,
description => 'The services tenant',
enabled => true,
}
Requirements
● features
● restrictions
We’re not alone
● terraform
● other config mgmt
○ chef
○ salt
○ ansible
● internal ops tools
Stage 1
Shelling out to the CLI
commands :keystone => "keystone"
def self.auth_keystone(*args)
authenv = {:OS_SERVICE_TOKEN => admin_token}
withenv authenv do
remove_warnings(keystone('--os-endpoint', admin_endpoint, args))
end
end
results = auth_keystone('tenant-create', '--name', resource[:name],
'--enabled', resource[:
enabled])
Shelling out to the CLI
# puppet apply keystone.pp --debug
Debug: Prefetching keystone resources for keystone_tenant
Debug: Executing '/usr/local/bin/keystone --os-endpoint http://127.
0.0.1:35357/v2.0/ tenant-list'
Debug: Executing '/usr/local/bin/keystone --os-endpoint http://127.
0.0.1:35357/v2.0/ tenant-create --name services --enabled True --
description The services tenant'
Notice: /Stage[main]/Main/Keystone_tenant[services]/ensure: created
#
What was good
● Idiomatic
● Debuggable
What was bad
● Instability
● Duplicated code
Why we switched
Instability
Stage 2
curl?
curl -H 'Content-Type: application/json' -X POST -d '{
"auth": {
"tenantName": "admin",
"passwordCredentials": {
"username": "admin",
"password": "passw0rd"
}
}
}' http://127.0.0.1:35357/v2.0/tokens
curl - Update a project (v2)
curl -H 'X-Auth-Token: 8bc163' -H 'Content-Type: application/json' 
-X POST -d '{
"tenant": {
"description": "new description",
"enabled": true
}
}' http://localhost:35357/v2.0/tenants/28551b
curl - Update a network (v2)
curl -H 'X-Auth-Token: 5a072f' -H 'Content-Type: application/json' 
-X PUT -d '{
"network": {
"admin_state_up": true
}
}' http://127.0.0.1:9696/v2.0/networks/ff9cc0
curl - Update an image (v1)
curl -H 'X-Auth-Token: c23ea2d' 
-H 'x-image-meta-disk_format: vhd' 
-X PUT http://localhost:9292/v1/images/7d863c
curl - Update an image (v2)
curl -H 'X-Auth-Token: 7ac5c8' 
-H 'Content-Type:
application/openstack-images-v2.1-json-patch' 
-d '[{
"path": "/disk_format", "value": "vhd", "op": "replace"
}]' 
-X PATCH http://127.0.0.1:9292/v2/images/40de3a
curl?
Let’s not reinvent a framework
An SDK?
“A set of language bindings that provide a
language-level API for accessing OpenStack in
a manner consistent with language standards.”
https://wiki.openstack.org/wiki/SDKs
An SDK?
“Currently, OpenStack's user stories for both
command-line and application developer
consumers of OpenStack based clouds is
confusing, fractured, and inconsistent.”
https://wiki.openstack.org/wiki/SDK-Development/PythonOpenStackSDK
fog?
● too big, too general-purpose
aviator
session = ::Aviator::Session.new(:config => configuration)
session.authenticate
response = session.request(:identity,
:create_tenant, options) do |params|
params.name = resource[:name]
params.enabled = resource[:enabled]
params.description = resource[:description]
end
What was good
● OpenStack-focused
● responsive maintainer
What was bad
● session management
● vendoring the gem
● question of sustainability
Why we switched
keystone v3
Stage 3
OpenStackClient (...another CLI)
# puppet apply keystone.pp --debug
Debug: Executing '/usr/local/bin/openstack project list --quiet
--format csv --long --os-token sosp-kyl --os-url http://127.
0.0.1:35357/v2.0/'
Debug: Executing '/usr/local/bin/openstack project create --
format shell services --enable --description The services tenant
--os-url http://127.0.0.1:35357/v2.0/'
Notice: /Stage[main]/Main/Keystone_tenant[services]/ensure:
created
#
What was good
● keystone v3 support
● distro packages
● well-supported
● consistency across modules
What was bad
● laggy support from distros
● stability is ?
Status
Incomplete
Colleen Murphy
cmurphy@hp.com
freenode: crinkle - #puppet-openstack
twitter: @pdx_krinkle
Questions or comments?

Weitere ähnliche Inhalte

Was ist angesagt?

openstack源码分析(1)
openstack源码分析(1)openstack源码分析(1)
openstack源码分析(1)
cannium
 
Getting Started with Couchbase Ruby
Getting Started with Couchbase RubyGetting Started with Couchbase Ruby
Getting Started with Couchbase Ruby
Sergey Avseyev
 

Was ist angesagt? (20)

RestMQ - HTTP/Redis based Message Queue
RestMQ - HTTP/Redis based Message QueueRestMQ - HTTP/Redis based Message Queue
RestMQ - HTTP/Redis based Message Queue
 
Node collaboration - Exported Resources and PuppetDB
Node collaboration - Exported Resources and PuppetDBNode collaboration - Exported Resources and PuppetDB
Node collaboration - Exported Resources and PuppetDB
 
Developers’ mDay 2019. - Rastko Vasiljević, SuperAdmins – Infrastructure as c...
Developers’ mDay 2019. - Rastko Vasiljević, SuperAdmins – Infrastructure as c...Developers’ mDay 2019. - Rastko Vasiljević, SuperAdmins – Infrastructure as c...
Developers’ mDay 2019. - Rastko Vasiljević, SuperAdmins – Infrastructure as c...
 
Openstack 簡介
Openstack 簡介Openstack 簡介
Openstack 簡介
 
Using ngx_lua in UPYUN
Using ngx_lua in UPYUNUsing ngx_lua in UPYUN
Using ngx_lua in UPYUN
 
Drupaljam 2017 - Deploying Drupal 8 onto Hosted Kubernetes in Google Cloud
Drupaljam 2017 - Deploying Drupal 8 onto Hosted Kubernetes in Google CloudDrupaljam 2017 - Deploying Drupal 8 onto Hosted Kubernetes in Google Cloud
Drupaljam 2017 - Deploying Drupal 8 onto Hosted Kubernetes in Google Cloud
 
Docker for data science
Docker for data scienceDocker for data science
Docker for data science
 
openstack源码分析(1)
openstack源码分析(1)openstack源码分析(1)
openstack源码分析(1)
 
PuppetCamp SEA 1 - Version Control with Puppet
PuppetCamp SEA 1 - Version Control with PuppetPuppetCamp SEA 1 - Version Control with Puppet
PuppetCamp SEA 1 - Version Control with Puppet
 
JDD 2017: Nginx + Lua = OpenResty (Marcin Stożek)
JDD 2017: Nginx + Lua = OpenResty (Marcin Stożek)JDD 2017: Nginx + Lua = OpenResty (Marcin Stożek)
JDD 2017: Nginx + Lua = OpenResty (Marcin Stożek)
 
Static Typing in Vault
Static Typing in VaultStatic Typing in Vault
Static Typing in Vault
 
Using docker for data science - part 2
Using docker for data science - part 2Using docker for data science - part 2
Using docker for data science - part 2
 
Getting Started with Couchbase Ruby
Getting Started with Couchbase RubyGetting Started with Couchbase Ruby
Getting Started with Couchbase Ruby
 
PhpTour Lyon 2014 - Transparent caching & context aware http cache
PhpTour Lyon 2014 - Transparent caching & context aware http cachePhpTour Lyon 2014 - Transparent caching & context aware http cache
PhpTour Lyon 2014 - Transparent caching & context aware http cache
 
1
11
1
 
Using python and docker for data science
Using python and docker for data scienceUsing python and docker for data science
Using python and docker for data science
 
Docker @ Data Science Meetup
Docker @ Data Science MeetupDocker @ Data Science Meetup
Docker @ Data Science Meetup
 
Top Node.js Metrics to Watch
Top Node.js Metrics to WatchTop Node.js Metrics to Watch
Top Node.js Metrics to Watch
 
Deploying Plone and Volto, the Hard Way
Deploying Plone and Volto, the Hard WayDeploying Plone and Volto, the Hard Way
Deploying Plone and Volto, the Hard Way
 
Installing hive on ubuntu 16
Installing hive on ubuntu 16Installing hive on ubuntu 16
Installing hive on ubuntu 16
 

Ähnlich wie Vancouver presentation

Projeto-web-services-Spring-Boot-JPA.pdf
Projeto-web-services-Spring-Boot-JPA.pdfProjeto-web-services-Spring-Boot-JPA.pdf
Projeto-web-services-Spring-Boot-JPA.pdf
AdrianoSantos888423
 
Web applications with Catalyst
Web applications with CatalystWeb applications with Catalyst
Web applications with Catalyst
svilen.ivanov
 

Ähnlich wie Vancouver presentation (20)

Projeto-web-services-Spring-Boot-JPA.pdf
Projeto-web-services-Spring-Boot-JPA.pdfProjeto-web-services-Spring-Boot-JPA.pdf
Projeto-web-services-Spring-Boot-JPA.pdf
 
AWS Study Group - Chapter 03 - Elasticity and Scalability Concepts [Solution ...
AWS Study Group - Chapter 03 - Elasticity and Scalability Concepts [Solution ...AWS Study Group - Chapter 03 - Elasticity and Scalability Concepts [Solution ...
AWS Study Group - Chapter 03 - Elasticity and Scalability Concepts [Solution ...
 
Gr8conf EU 2018 - Bring you infrastructure under control with Infrastructor
Gr8conf EU 2018 - Bring you infrastructure under control with InfrastructorGr8conf EU 2018 - Bring you infrastructure under control with Infrastructor
Gr8conf EU 2018 - Bring you infrastructure under control with Infrastructor
 
Puppet: Eclipsecon ALM 2013
Puppet: Eclipsecon ALM 2013Puppet: Eclipsecon ALM 2013
Puppet: Eclipsecon ALM 2013
 
Burn down the silos! Helping dev and ops gel on high availability websites
Burn down the silos! Helping dev and ops gel on high availability websitesBurn down the silos! Helping dev and ops gel on high availability websites
Burn down the silos! Helping dev and ops gel on high availability websites
 
Just one-shade-of-openstack
Just one-shade-of-openstackJust one-shade-of-openstack
Just one-shade-of-openstack
 
Helm @ Orchestructure
Helm @ OrchestructureHelm @ Orchestructure
Helm @ Orchestructure
 
Exploring the Future of Helm
Exploring the Future of HelmExploring the Future of Helm
Exploring the Future of Helm
 
Heat up your stack
Heat up your stackHeat up your stack
Heat up your stack
 
Cloud-native applications with Java and Kubernetes - Yehor Volkov
 Cloud-native applications with Java and Kubernetes - Yehor Volkov Cloud-native applications with Java and Kubernetes - Yehor Volkov
Cloud-native applications with Java and Kubernetes - Yehor Volkov
 
Web applications with Catalyst
Web applications with CatalystWeb applications with Catalyst
Web applications with Catalyst
 
Ansible inside
Ansible insideAnsible inside
Ansible inside
 
2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOps
2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOps2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOps
2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOps
 
Amazon Web Services and Docker: from developing to production
Amazon Web Services and Docker: from developing to productionAmazon Web Services and Docker: from developing to production
Amazon Web Services and Docker: from developing to production
 
Continuous deployment of puppet modules
Continuous deployment of puppet modulesContinuous deployment of puppet modules
Continuous deployment of puppet modules
 
My First Big Data Application
My First Big Data ApplicationMy First Big Data Application
My First Big Data Application
 
Infrastructure = code - 1 year later
Infrastructure = code - 1 year laterInfrastructure = code - 1 year later
Infrastructure = code - 1 year later
 
Understanding OpenStack Deployments - PuppetConf 2014
Understanding OpenStack Deployments - PuppetConf 2014Understanding OpenStack Deployments - PuppetConf 2014
Understanding OpenStack Deployments - PuppetConf 2014
 
Docker for Ruby Developers
Docker for Ruby DevelopersDocker for Ruby Developers
Docker for Ruby Developers
 
Automatically Scaling Your Kubernetes Workloads - SVC209-S - Anaheim AWS Summit
Automatically Scaling Your Kubernetes Workloads - SVC209-S - Anaheim AWS SummitAutomatically Scaling Your Kubernetes Workloads - SVC209-S - Anaheim AWS Summit
Automatically Scaling Your Kubernetes Workloads - SVC209-S - Anaheim AWS Summit
 

Kürzlich hochgeladen

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 

Kürzlich hochgeladen (20)

Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 

Vancouver presentation

  • 2. The problem We need to manage OpenStack resources with puppet
  • 3. Lightning intro to puppet ● resource - something being managed on a system ● type - the interface of the resource ● provider - the backend implementation of the resource
  • 4. Example: file file { '/root/example': ensure => present, content => 'A file resource managed by puppet', mode => '0644', }
  • 5. Example: mysql_database mysql_database { 'keystone': ensure => present, charset => 'utf8', collate => 'utf8_general_ci', }
  • 6. Example: mysql_database # puppet apply mysql.pp --debug Debug: Prefetching mysql resources for mysql_database Debug: Executing '/usr/bin/mysql --defaults-extra-file=/root/.my.cnf -NBe show databases' Debug: Executing '/usr/bin/mysql --defaults-extra-file=/root/.my.cnf -NBe create database if not exists `keystone` character set `utf8` collate `utf8_general_ci`' Notice: /Stage[main]/Main/Mysql_database[keystone]/ensure: created #
  • 7. Example: keystone_tenant keystone_tenant { 'services': ensure => present, description => 'The services tenant', enabled => true, }
  • 9. We’re not alone ● terraform ● other config mgmt ○ chef ○ salt ○ ansible ● internal ops tools
  • 11. Shelling out to the CLI commands :keystone => "keystone" def self.auth_keystone(*args) authenv = {:OS_SERVICE_TOKEN => admin_token} withenv authenv do remove_warnings(keystone('--os-endpoint', admin_endpoint, args)) end end results = auth_keystone('tenant-create', '--name', resource[:name], '--enabled', resource[: enabled])
  • 12. Shelling out to the CLI # puppet apply keystone.pp --debug Debug: Prefetching keystone resources for keystone_tenant Debug: Executing '/usr/local/bin/keystone --os-endpoint http://127. 0.0.1:35357/v2.0/ tenant-list' Debug: Executing '/usr/local/bin/keystone --os-endpoint http://127. 0.0.1:35357/v2.0/ tenant-create --name services --enabled True -- description The services tenant' Notice: /Stage[main]/Main/Keystone_tenant[services]/ensure: created #
  • 13. What was good ● Idiomatic ● Debuggable
  • 14. What was bad ● Instability ● Duplicated code
  • 17. curl? curl -H 'Content-Type: application/json' -X POST -d '{ "auth": { "tenantName": "admin", "passwordCredentials": { "username": "admin", "password": "passw0rd" } } }' http://127.0.0.1:35357/v2.0/tokens
  • 18. curl - Update a project (v2) curl -H 'X-Auth-Token: 8bc163' -H 'Content-Type: application/json' -X POST -d '{ "tenant": { "description": "new description", "enabled": true } }' http://localhost:35357/v2.0/tenants/28551b
  • 19. curl - Update a network (v2) curl -H 'X-Auth-Token: 5a072f' -H 'Content-Type: application/json' -X PUT -d '{ "network": { "admin_state_up": true } }' http://127.0.0.1:9696/v2.0/networks/ff9cc0
  • 20. curl - Update an image (v1) curl -H 'X-Auth-Token: c23ea2d' -H 'x-image-meta-disk_format: vhd' -X PUT http://localhost:9292/v1/images/7d863c
  • 21. curl - Update an image (v2) curl -H 'X-Auth-Token: 7ac5c8' -H 'Content-Type: application/openstack-images-v2.1-json-patch' -d '[{ "path": "/disk_format", "value": "vhd", "op": "replace" }]' -X PATCH http://127.0.0.1:9292/v2/images/40de3a
  • 23. An SDK? “A set of language bindings that provide a language-level API for accessing OpenStack in a manner consistent with language standards.” https://wiki.openstack.org/wiki/SDKs
  • 24.
  • 25.
  • 26. An SDK? “Currently, OpenStack's user stories for both command-line and application developer consumers of OpenStack based clouds is confusing, fractured, and inconsistent.” https://wiki.openstack.org/wiki/SDK-Development/PythonOpenStackSDK
  • 27. fog? ● too big, too general-purpose
  • 28. aviator session = ::Aviator::Session.new(:config => configuration) session.authenticate response = session.request(:identity, :create_tenant, options) do |params| params.name = resource[:name] params.enabled = resource[:enabled] params.description = resource[:description] end
  • 29. What was good ● OpenStack-focused ● responsive maintainer
  • 30. What was bad ● session management ● vendoring the gem ● question of sustainability
  • 33. OpenStackClient (...another CLI) # puppet apply keystone.pp --debug Debug: Executing '/usr/local/bin/openstack project list --quiet --format csv --long --os-token sosp-kyl --os-url http://127. 0.0.1:35357/v2.0/' Debug: Executing '/usr/local/bin/openstack project create -- format shell services --enable --description The services tenant --os-url http://127.0.0.1:35357/v2.0/' Notice: /Stage[main]/Main/Keystone_tenant[services]/ensure: created #
  • 34. What was good ● keystone v3 support ● distro packages ● well-supported ● consistency across modules
  • 35. What was bad ● laggy support from distros ● stability is ?
  • 37. Colleen Murphy cmurphy@hp.com freenode: crinkle - #puppet-openstack twitter: @pdx_krinkle Questions or comments?