Transcript - OpenStack

OpenStackClient
Your CLI experience matters!
Dean Troyer
Software Developer, Intel
OpenStackClient PTL
Twitter: @dtroyer
Steve Martinelli
Software Developer, IBM
Keystone PTL, OpenStackClient Core
Twitter: @stevebot
About the presenters
Dean Troyer
● Senior Cloud Software Developer @ Intel
● OpenStackClient PTL (and creator!)
● Been working on OpenStack since day 0
● Twitter: @dtroyer
Steve Martinelli
● Senior Software Developer @ IBM
● Keystone PTL and OpenStackClient Core Reviewer
● Been contributing to OpenStack since the Grizzly release
● Twitter: @stevebot
Agenda
● Overview of OpenStackClient (OSC)
● Scope of OpenStackClient
● What’s new in 3.0.0?
● UX Commandments
● OpenStackClient parity
● Who uses OpenStackClient?
● How you can contribute?
● Future Plans for OpenStackClient
Overview of
OpenStackClient
Overview of OpenStackClient
Mission statement:
● OpenStackClient (aka OSC) is a command-line client for OpenStack that provides a uniform set of
commands for Compute, Identity, Image, Network, Object Storage, and Block Storage APIs
In simple terms:
● Provide a better user experience (UX) with the CLI, via a single pane of glass, that is consistent
Scope of OpenStackClient
Scope of OpenStackClient
● What is “in the box”
○ Compute (nova)
○ Identity (keystone) v2 and v3
○ Image (glance) v1 and v2
○ Network (neutron)
○ Object (swift)
○ Volume (cinder) v1 and v2
● Additional projects are supported as “plugins”
○ Install openstackclient first
○ Install a plugin of your choice! (heatclient, barbicanclient, etc)
● What is missing from the ecosystem?
○ Database (trove), Containers (magnum), Telemetry (ceilometer), SW Dev Lifecycle (solum)
Scope of OpenStackClient
zaqar
tripleo
senlin
sahara
searchlight
aodh
sahara
Image
Compute
gnocchi
Network
OpenStackClient
Identity
murano
Object
Volume
barbican
mistal
congress
cue
designate
heat
ironic
What’s new in
OpenStackClient 3.0.0?
OpenStackClient 3.0.0
During the Newton development cycle, we released OpenStackClient 3.0.0, this was a MAJOR release!
●
Added a ton of networking commands (agent, network rbac, port, subnet, fixed and floating ip address,
router, etc)
○ Made networking commands service-agnostic. The commands common to both will work with
Neutron and Nova-net (whenever possible)!
○ Special thanks to Richard Theis and the Neutron team for making this happen!
●
Integrated with keystoneauth
○ Now able to authenticate with any number of keystone supported plugins
●
First release of osc-lib -- a library that OpenStackClient plugins can depend on, rather than using all of
python-openstackclient
●
Support bulk deletion for all delete commands
OpenStack UX
Commandments
UX commandment #1
$ openstack user delete user1 user2
$ openstack volume delete volume1 volume2
Thou shalt always provide a
multi-delete option
UX commandment #2
$ openstack volume set <volume>
[--name <name>]
[--description <description>]
[--bootable | --non-bootable]
[--properties <key=value>]
[--state <state>]
[--size <size>]
Instead of
Thou shalt always group
operations logically, NOT by API
$
$
$
$
$
cinder
cinder
cinder
cinder
cinder
set-bootable <volume> <True|true|False|false>
metadata <volume> <action> <key=value>
extend <volume> <new_size>
reset-state <volume> --state <state>
<i-don’t-know-which-cmd-to-change-name>
UX commandment #3
$ openstack volume set vol2 --size 3 --property foo=bar
Failed to set volume size: Volume is in error state, it
must be available before size can be extended
One or more of the set operations failed
$ openstack volume set vol2 --size 3 --name vol3
Failed to set volume size: New size must be greater
than 4 GB
One or more of the set operations failed
Provide meaningful error
messages
$ openstack volume delete vol1 vol2
Failed to delete volume with name or ID 'vol1': No
volume with a name or ID of 'vol1' exists.
1 of 2 volumes failed to delete
Leverage -c and -f value to get the value directly
UX commandment #4
$ openstack user create user3 -c id -f value
ae33531e0d064052aafe47e18503453a
Works with lists too!
$ openstack user list -c ID -f value
2e7c787e522940549195acfbed96c3a8
879b10520fae4949829b4bbdb0c0338a
Down with prettyTable! Long live
cliff!
Rather than:
$ keystone user create foo | grep " id " | get_field 2
$ keystone user-list | awk "/ foo / { print \$2 }"
Leverage built-in formatters when showing data
UX commandment #5
Thou shalt provide YAML, JSON
and CSV support
$ openstack user list -c Name -c ID -f
json
[
{
"ID": "09e4cfd6adb25a77ccaef4b0a5",
"Name": "alt_demo"
},
{
"ID": "1e186fac6a04cab99cc52afe81",
"Name": "user2"
}
]
$ openstack user show --help
positional arguments:
<user>
User to display (name or ID)
UX commandment #6
Support both name and ID when
possible (hide this distinction
from the user!)
$ openstack user show user3
+----------+----------------------------------+
| Field
| Value
|
+----------+----------------------------------+
| email
| None
|
| enabled | True
|
| id
| ae33531e0d064052aafe47e18503453a |
| name
| user3
|
| username | user3
|
+----------+----------------------------------+
$ openstack user show ae33552aafe47e18503453a
+----------+---------------------------------+
| Field
| Value
|
+----------+----------------------------------+
| email
| None
|
| enabled | True
|
| id
| ae33531e0d064052aafe47e18503453a |
| name
| user3
|
| username | user3
|
+----------+----------------------------------+
UX commandment #7
Use project not tenant
Use real words for resources
Do not abbreviate
Do not include hyphens (-) or underscores
(_)
Use properties not metadata
Above all, be CONSISTENT
OpenStackClient Parity with
Legacy CLIs
OpenStackClient Parity with Legacy CLIs
● What’s commands are missing from the project CLIs when compared to OSC?
○
○
○
○
○
○
Compute
■ Pretty good! Some contrib items missing, but the most used commands are in!
Identity
■ Fully compatible with both v2 and v3 APIs. Keystone CLI was removed in Mitaka!
Image
■ Pretty good compatibility with v1; lacking new commands introduced in v2
Network
■ Neutron CLI v6.0.0 has 128 core commands with 56% transitioned to OSC
■ OSC has 77 network commands ( with WIP patches for another 30+ commands)
■ Missing support for VPNaaS, LBaaS, FWaaS and BGP
■ Gets tricky for advanced features/services due to stadium approach
Object
We are constantly playing
■ Basic support, could be better
catch-up. We have to aim for
Volume
high value targets first -- the
■ About 80% of v1 CLI commands are implemented
commands that are most often
■ About 65-70% of v2 CLI commands are implemented
used. We fill in the gaps as the
need arises.
Who uses OpenStackClient?
Who uses OpenStackClient?
Glowing reviews for OpenStackClient
https://www.mail-archive.com/[email protected]/msg64944.html
Glowing reviews for OpenStackClient
https://www.mail-archive.com/[email protected]/msg79361.html
How can you contribute to
OpenStackClient?
How can you contribute?
As a user / operator
● We love hearing feedback, good or bad.
○ File a bug report
○ Poke dtroyer or stevemar on IRC (#openstack-sdks)
○ Tweet about it
○ Post something on the mailing list
As a developer
● Help get us to parity!
As a PTL of another project (nova, neutron, cinder, glance)
● If a contributor is creating a new command for the project Python library and/or CLI, enforce that they add
it to OpenStackClient as well.
Future Plans for
OpenStackClient
Future Plans for OpenStackClient
●
Plugin enhancements
○ Extend existing commands (i.e. allow plugins to hook into the quota commands)
●
Handle business logic
○ Create a purge command to remove everything associated with a project
●
--help needs help
●
Local caching of tokens
●
Keyring integration
●
Move additional common bits into osc-lib
●
Output column naming
Questions (and hopefully answers)?