RFE - Use an options file for deployment

Bug #1698302 reported by Marios Andreou
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tripleo
Triaged
Wishlist
Unassigned

Bug Description

(copy/paste - email from Graeme Gillies):

So in general the philosophy for operations is, command line arguments
are perfectly fine for a few different things

1) Once off tasks (I wish to create an instance quickly using the
command line)
2) Simple systems (I want to list files in a directory with special
switches, so I use command line arguments to ls)
3) Overwriting default or configured settings once off (e.g. if I want
to run puppet with all settings from puppet.conf, but change the
environment, I'll run puppet agent --test --environment different)

The 'openstack overcloud XXX' commands (deploy, update) *don't* fit this
pattern yet heavily rely on command line options. This is why operators
constantly run into these issues, because we don't expect to have to
commit command line options to memory, because our philosophy is they
are persistent configuration items for the environment, not fitting into
the use cases above.

What we should be doing is forcing our 'openstack overcloud' commands
out from command line options altogether. What I am thinking is we have
it work like this

You create a file called overcloud-settings.yaml (or something) which
might look like the following

---
templates: /home/stack/rdocloud-tripleo/overcloud/templates
timeout: 240
validation_warnings: fatal
overcloud_ssh_user: rdo-admins
environment_files:
  - templates/environments/puppet-pacemaker.yaml
  - templates/environments/network-isolation.yaml
  - templates/environments/network-management.yaml
  - templates/environments/ips-from-pool-all.yaml
  - templates/environments/storage-environment.yaml
  - templates/environments/monitoring-environment.yaml
  - templates/environments/logging-environment.yaml
  - rdocloud-host-definitions.yaml
  - rdocloud-storage-environment.yaml
  - rdocloud-network-environment.yaml
  - rdocloud-customisations.yaml
  - rdocloud-opstools-params.yaml
  - rdocloud-roles-data.yaml

Then whenever you ran 'openstack overcloud deploy' or 'openstack
overcloud update' it would look in the current working directory for
overcloud-settings.yaml and load in the config from there. No more
people forgetting to add environment files.

You can still keep the command line switches, for once off tasks. For
example with the file above, lets say I wish to increase the timeout for
1 stack update only as I think it will take longer for some reason. I
could do

openstack overcloud deploy --timeout 360

And all other settings would be used from the file. Likewise, when we
have tasks (like major upgrades) where we require people to include
extra environment files once off, we can get them to do

openstack overcloud deploy -e
templates/environments/upgrades/major-upgrade-whatever-step1.yaml

And it would read the environment files (and other settings) from
overcloud-settings.yaml and append the major-upgrade-whatever-step1.yaml
to the end of the list.

Another use case would be if I am an operator or developer hacking on
templates and want to test my hacked templates once off, I could do

openstack overcloud deploy --templates gg-hacked-templates

and it would use my templates dir, but all other settings from the file.

Finally, this would also allow us to do another workflow which is better
merging and synchronization of multiple environments in the one git
repo. In the typical case for stage/prod, we can have all the templates
and customisations for both environments in the one git repo and do
something like

openstack overcloud deploy -c overcloud-settings-stage.yaml

To differentiate between using the settings file for staging vs
production. This would massively improve usability from our perspective,
combined with the options above, it would allow me to do something like

openstack overcloud deploy -c overcloud-settings-rdo-cloud-stage.yaml
--templates gg-hacked-templates

To test my hacked template work on our staging environment without
having to remember the spaghetti mess of command line options I need.

Also for multiple overcloud environments people could do

openstack overcloud deploy -c overcloud-settings-phx2.yaml
openstack overcloud deploy -c overcloud-settings-rdu2.yaml

They would be run on different underclouds, but keeping the work in the
same git repo ensures that both environments use identical templates and
other configurations.

If we implemented this and pushed all documentation to reference it as
the main way of using TripleO, I think you would find it improves
usability by a *massive* amount.

Thoughts?

Revision history for this message
Carlos Camacho (ccamacho) wrote :

I agree on this, having an input file instead of several command parameters will help a lot on usability.

Revision history for this message
Sofer Athlan-Guyot (sofer-athlan-guyot) wrote :

Hi very good idea.

the way I see it that could work like this:

 openstack overcloud deploy --env prod

this would parse a file in:

 ~/.config/tripleo/env.yaml

or

 ~/.tripleo_envs

or .. ?

The file should have the a ini format (as the rest of openstack)

[DEFAULT] # for all env
environment_file = blah.yaml
environment_file = foo.yaml
environment_file = bar.yaml
....

[prod] # production env
...

[test] # test env
...

WDYT?

Revision history for this message
Julie Pichon (jpichon) wrote :

Note that at least for the environment files list, this is already how we work when deploying from the UI, and I believe shardy is working on making the CLI play more nicely with the list of environments as well (though I don't remember as part of which bug). Currently the CLI mangles all the environments into one big file.

If I define the environments via the UI, plan-environment.yaml in Swift is updated with the list of individual environments:

name: demo-overcloud
environments:
- path: overcloud-resource-registry-puppet.yaml
- path: environments/tls-endpoints-public-ip.yaml
- path: environments/enable-tls.yaml
parameter_defaults:
  BlockStorageCount: 0
  CephStorageCount: 1
[...]

This can also be used directly to deploy from the CLI by using the "openstack overcloud plan deploy <plan_name>" (as opposed to "openstack overcloud deploy").

Though of course that doesn't include all of the CLI switches from "overcloud deploy", if they don't translate to a parameter_defaults.

About the suggested "templates" field, ideally we should be assuming the deployment is happening based on the templates & environments uploaded to the Swift container, rather than local files - jtomasek wrote a good email about it: http://lists.openstack.org/pipermail/openstack-dev/2017-June/118213.html

I'm not saying this solves everything described here, just that this looks like a good starting point that is also compatible with the UI and existing tripleo-common workflows.

Changed in tripleo:
status: New → Triaged
importance: Undecided → Wishlist
milestone: none → queens-1
Changed in tripleo:
milestone: queens-1 → queens-2
Changed in tripleo:
milestone: queens-2 → queens-3
Changed in tripleo:
milestone: queens-3 → queens-rc1
Changed in tripleo:
milestone: queens-rc1 → rocky-1
Changed in tripleo:
milestone: rocky-1 → rocky-2
Changed in tripleo:
milestone: rocky-2 → rocky-3
Changed in tripleo:
milestone: rocky-3 → rocky-rc1
Changed in tripleo:
milestone: rocky-rc1 → stein-1
Changed in tripleo:
milestone: stein-1 → stein-2
Changed in tripleo:
milestone: stein-2 → stein-3
Changed in tripleo:
milestone: stein-3 → train-1
Changed in tripleo:
milestone: train-1 → train-2
Changed in tripleo:
milestone: train-2 → train-3
Changed in tripleo:
milestone: train-3 → ussuri-1
Changed in tripleo:
milestone: ussuri-1 → ussuri-2
wes hayutin (weshayutin)
Changed in tripleo:
milestone: ussuri-2 → ussuri-3
wes hayutin (weshayutin)
Changed in tripleo:
milestone: ussuri-3 → ussuri-rc3
wes hayutin (weshayutin)
Changed in tripleo:
milestone: ussuri-rc3 → victoria-1
Changed in tripleo:
milestone: victoria-1 → victoria-3
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.