Commit Graph

49 Commits

Author SHA1 Message Date
Tony Breeds ada02718a1 Remove Old baremetal commands provided by python-tripleoclient
python-tripleoclient provides the following openstack baremetal
commands:

openstack baremetal instackenv validate:
openstack baremetal import:
openstack baremetal introspection bulk start:
openstack baremetal introspection bulk status:
openstack baremetal configure ready state:
openstack baremetal configure boot:

Based on the data below several of these are already deprecated and have
been so longer enough to be removed.

openstack baremetal instackenv validate:
    tripleoclient.v1.baremetal:ValidateInstackEnv
    NOT Deprecated
openstack baremetal import:
    tripleoclient.v1.baremetal:ImportBaremetal
    DEPRECATED in b272a5c6 2017-01-03
    New command: openstack overcloud node import
openstack baremetal introspection bulk start:
    tripleoclient.v1.baremetal:StartBaremetalIntrospectionBulk
    DEPRECATED in b272a5c6 2017-01-03
    New command: openstack overcloud node introspect
openstack baremetal introspection bulk status:
    tripleoclient.v1.baremetal:StatusBaremetalIntrospectionBulk
    NOT Deprecated
openstack baremetal configure ready state:
    tripleoclient.v1.baremetal:ConfigureReadyState
    NOT Deprecated
openstack baremetal configure boot:
    tripleoclient.v1.baremetal:ConfigureBaremetalBoot
    DEPRECATED in b272a5c6 2017-01-03
    New command: openstack overcloud node configure

This leaves:
openstack baremetal instackenv validate
- This is somewhat superceded by the mistral validation in
  tripleo-common
openstack baremetal introspection bulk status
- This should have been deprecated along with
  'openstack baremetal introspection bulk start' and isn't useful without
  the former.
openstack baremetal configure ready state
- Seems to only support drac and requires a datafile no loner generated
  by tools

As these commands have outlived their useful lifetime and do not require
deprecation we're free to remove them so let do it.

Change-Id: Ie6b6a8578e4d12503a3dbfa5747309033d53466e
2017-12-18 11:50:45 +11:00
Dougal Matthews 53d06b7f52 Add each command to the history file
Change-Id: I1e93305426dd94dbbcc8ca70f446dae4a1fa0434
2017-11-27 15:37:00 +00:00
Toure Dunnon 1bd1620ead Tripleoclient unified queue name.
This will allow the cli and tripleo UI to share a common queue,
which will help with scripting the frontend behaviour or track
the progress of the cli from the frontend.

Related-Bug: #1603345

Change-Id: I5849983eee82b5a56cae1bf38a3c2694b6b291db
2017-11-06 13:46:14 -05:00
Jehoszafat Zimnowoda b60d221fe1 Use simplejson to load json file
The simplejson extends json library. It provides sufficient information about
JSON syntax errors, which often occurs during instackenv.json file creation.

Change-Id: Ied1c080678af728820e02b7b99c51762b49b1449
Closes-Bug: #1693442
Depends on external: https://review.rdoproject.org/r/#/c/7872/
2017-07-24 23:05:35 +02:00
Dmitry Tantsur 759dff71d8 Fix 'introspection bulk status' when some nodes were never introspected
Previously we did not handle exceptions from ironic_inspector_client, so nodes
that were never introspected (e.g. ones in maintenance mode) caused this
command to fail.

Change-Id: I58756256fe70992ff5618a3f307ce34f95e71efd
Closes-Bug: #1689540
2017-05-23 12:23:03 +02:00
Brad P. Crochet 553e46e76a Add support for calling validations from introspection
The 'bulk introspection start' and 'overcloud node introspect' commands
can now enable the usage of the additional validations that are called
via workflows.
Commands now accept a '--run-validations' switch.

Change-Id: Ifcb30b9ceb15d82fffcda24cb98f2d03f4ded354
Partial-Bug: #1638697
Depends-On: I439361ae20c4e302b83870cdc06a5baa90ea683c
2017-01-26 15:55:39 -05:00
Julie Pichon b272a5c664 Deprecate legacy 'baremetal' commands
The new node management commands added during Newton as part of the
Mistral migration/API redesign should be used instead. For additional
background information, the thread at [1] is a good reference.

Closes-Bug: #1649541

[1] http://lists.openstack.org/pipermail/openstack-dev/2016-May/095456.html

Depends-On: I7f51190925f7ac1bfa9b122d3b746f2fd6858076
Change-Id: I5997905834f02d47811d28e337d6b2b4f85a75b7
2017-01-10 09:29:55 +00:00
Jenkins 83d6d177e1 Merge "Remove separate call to provide workflow" 2017-01-05 14:48:19 +00:00
Jenkins 8f74280843 Merge "Remove "baremetal show capabilities" command" 2016-12-01 22:09:30 +00:00
Brad P. Crochet 4b775db3d4 Remove separate call to provide workflow
The provide workflow is now called directly from the register_or_update
workflow. It should no longer be called from the client.

Change-Id: I127061eff8763c159f380dd47d3a06813184faba
Depends-On: I40f0b27a0f38447372181f9fae6a31e57dbd79e4
Closes-Bug: #1637474
2016-11-22 11:04:38 -05:00
Dmitry Tantsur 11e1c3c610 Do not try to "provide" updated nodes not in "manageable" state
The "import" command can update existing nodes, which are not necessary
in "manageable" state. However, we try to unconditionally run the "provide"
workflow for such nodes. This change limits it to only "manageable" nodes.

Change-Id: I15219e53abeb43712b25cb3098334f4805f762b5
Partial-Bug: #1635240
2016-11-03 11:12:42 +01:00
Dmitry Tantsur 76cb55a26b Remove "baremetal show capabilities" command
It has been in conflict with "baremetal show" command provided by Ironic
since Mitaka, and due to that has been completely broken. The only
reason we haven't noticed that is because nobody uses this command.
Let's just remove it.

Change-Id: I645536f0ae0af3bd318db26543a662de659a27a5
2016-10-17 10:10:27 +02:00
Dougal Matthews 133e8cf91a Migrate to using osc-lib
This new library provides the common logic used by openstack
clients. Replacing the imports from openstackclient and cliff.

Depends-On-External: https://review.rdoproject.org/r/#/c/2088/
Depends-On: I095209c241876c6ab48595962e07144fc5cc34a6
Closes-Bug: #1620964
Change-Id: I103a13ff6c0af94b82f5e48652380adfbf331d34
2016-09-13 22:35:01 +00:00
Julie Pichon 6900d694e3 Use Mistral for baremetal boot configuration
This updates the 'baremetal configure boot' command to work with the
new Mistral workflow. The Root Device tests have migrated to
tripleo-common where the main code now lives as a Mistral action (see
dependent patch).

Change-Id: I3acbfd7900177fc2159448b839b71599e8e51d5f
Depends-On: I5ba0a3710012c44822dd3b8e69662bbef04d3787
Related-Bug: #1595205
2016-08-25 20:51:45 +01:00
Julie Pichon dbe3b866a5 Add 'openstack overcloud node import' command
The new commands aim to simplify the node management workflow
[1]. Additional configuration will be possible via 'openstack overcloud
node configure.'

[1] http://lists.openstack.org/pipermail/openstack-dev/2016-May/095456.html

Change-Id: I704438da31a31a90f882ddd01ba02e3ca62549ac
Depends-On: Iea9b7f3b49f99f810ce759f65b45b88c1c40f010
Partial-Bug: #1595205
2016-08-25 20:36:23 +01:00
Jenkins 82ce6ba6c9 Merge "Support node capabilities as dictionaries" 2016-08-08 09:36:57 +00:00
Dmitry Tantsur a08f2ecb8c Support node capabilities as dictionaries
This is more readable that the current Ironic format, and tripleo-common
supports starting with fc05b1bdac1554ec81be9ead55e225cd2f59ccae.

Change-Id: I733ae03d04a96941285e2767bafa7d19083aba87
2016-07-19 14:17:24 +02:00
Julie Pichon 6108b3be7d Add 'openstack overcloud node introspect' command
Change-Id: I1c58d9c825543cf402ff417d1fd05e89759e3ecd
Partial-Bug: #1595205
2016-07-11 08:50:02 +01:00
Dougal Matthews f1398ac51b Use Mistral for baremetal introspection
Updates the baremetal introspection workflows to use Mistral
instead of python.

Change-Id: I0dd051bb6585421455d88b63adff5c9249aae2c5
2016-07-08 15:43:20 +01:00
Dan Prince 9244349742 Use Mistral for baremetal registration
Updates the baremetal registration workflows to use Mistral
instead of python.

Co-Authored-By: Dougal Matthews <dougal@redhat.com>
Co-Authored-By: Ryan Brady <rbrady@redhat.com>

Change-Id: Ide8b7753829170f503ef962b4ad4fde388cbb0ba
Depends-On: Ifc6bdd273a8e129ea7c4269d00add64e72cd371b
Depends-On: I910f50a377bcbc2c23b527953e9df7eee9c938a4
2016-07-08 15:43:18 +01:00
Julie Pichon 15d79ffd45 Add missing i18n marker on some help strings
Change-Id: I78b058ae26c06d83f7dea55bfcfb0df834d2eaa0
2016-07-05 14:39:46 +01:00
Dmitry Tantsur 8e13b39264 Fixed incorrect information in baremetal configure boot help
Change-Id: I1ea689b78912109f1c6ce0847dfbbeba0ff7ab78
2016-06-02 18:19:21 +02:00
Jenkins 79fea49dd1 Merge "Allow import command to set deploy image and local boot" 2016-05-19 08:09:57 +00:00
Dmitry Tantsur aa514daead Allow import command to set deploy image and local boot
In our default flow we already have all the images uploaded by the time we
import the Ironic nodes. So we can make the "configure boot" command optional
by setting images and the local boot capability right during the import.

This change also introduces 2 more flags to opt-out from these changes:
--no-deploy-image will skip setting the deploy image
--instance-boot-option allows setting the boot_option capability explicitly
(it still requires changing flavors to match)

It's still possible to override the capabilities in the instackenv.json.

Change-Id: I00bbdff724ecfd6b840a74767617126734d7a32c
2016-05-17 15:03:13 +02:00
Jenkins 02fd96fdfb Merge "Use wait_for_finish from python-ironic-inspector-client" 2016-04-20 13:28:33 +00:00
Jenkins d53b125685 Merge "Use Ironic API v1.11 to support ENROLL state" 2016-04-20 11:52:28 +00:00
Dmitry Tantsur 1d25ccf80e Use wait_for_finish from python-ironic-inspector-client
Drop our own implementation in favor of it.

Change-Id: Ib1d2d22f04a9477cd660ea685e975b5c80da6a3b
2016-04-08 14:52:34 +02:00
Jenkins e63a51784d Merge "Update baremetal ready state command" 2016-04-07 10:20:13 +00:00
Jenkins 76c8198dc4 Merge "Remove hardcoded delay between introspections" 2016-04-07 10:12:01 +00:00
Jenkins 71386ff20d Merge "Allow 'openstack baremetal configure boot' to guess the root device" 2016-04-06 08:02:50 +00:00
Miles Gould 20fa1ba84f Use Ironic API v1.11 to support ENROLL state
This state was introduced in Liberty as a new state for freshly enrolled
nodes, but is only exposed to clients who specify an API version >=
1.11. We add a new --initial-state parameter to `openstack baremetal
import` to enable use of the new state.

Change-Id: If04889c3778827a77236f6d88617211ecc0f4161
2016-04-05 12:30:34 +01:00
Imre Farkas a6dc90b748 Update baremetal ready state command
...by removing the RAID related functionality because it only existed in
the rdo-management repos but not in upstream Ironic.

Change-Id: I0913a70c8f50ab6a80f527086ad7c78a5ddde3e1
2016-03-30 15:15:45 +02:00
Dmitry Tantsur d3457ac799 Deprecate "baremetal show capabilities" command
This command was introduced to display node profiles. This job is now better
done by the "overcloud profiles list" command. As a result, this command is not
covered by our documentation at all.

Also, Ironic will have its own API and commands for handling capabilities
reasonably soon, so we risk clashing with them.

Change-Id: I423a03801280b9f9614214a7b8a615e8056b9b25
2016-03-30 14:18:25 +02:00
Dmitry Tantsur ceabf658b8 Allow 'openstack baremetal configure boot' to guess the root device
This change simplifies using Ironic root device hints for people who only need
to change the default strategy of selecting the default device.
E.g. we have a use case for selecting the first device instead of the smallest,
so that the root device does not change after upgrade Kilo -> Liberty.

Note that this feature does not replace per-node device hints, rather
complement them with a more global and easy to use setting.

This change introduces 3 new arguments to the command:
--root-device states how to find a root devices for a node.
  If this argument is provided, the client will try to detect the root device
  based on the stored introspection data. Possible values:
  * smallest (the same thing as IPA does by default - the smallest device)
  * largest (the opposite thing - pick the largest device)
  * otherwise it's treated as a comma-separated list of possible device names,
    e.g. sda,vda,hda rouchly matches the logic the Kilo ramdisk used.
  The resulting device WWN or serial (whatever is available) is then recorded
  in the root device hints (/properties/root_device) for a node.
--root-device-minimum-size minimum size of the considered devices
  The default value of 4 GiB matches what IPA does.
--overwrite-root-device-hints allows overwriting root device hints set
  previously. It's disabled by default to allow more precise control over the
  root device for some subset of nodes.

Note that for these arguments to work, this command should be run after
introspection. A separate documentation change will be posted for that.

Change-Id: I9f19554c5e7f34c8f63c1603c32b4d470fb12592
2016-03-24 10:11:11 +00:00
Dmitry Tantsur d15e6fd971 Switch to using node utilities from tripleo-common
Change-Id: I02b6d84c9b9b3aee01e22b4ba3baa55e45f90ad5
Depends-On: I7efffc5c6627776a20fad4bf4cf266330c4b8b6b
2016-03-22 10:01:44 +00:00
Steven Hardy cef1c520e9 Allow node import via yaml not only csv/json
JSON, and to a lesser extent CSV, are not friendly formats for human
users, so also support yaml.

Also make the --json/--csv options deprecated and optional - we can
just detect the filetype via the suffix instead of introducting a
new option enabling yaml support.

Note there are future improvements we can make around the test here,
e.g reducing duplication via testscenarios and improving the handling
of temporary files, but I've not considered that in this patch and
have stuck with the current conventions.

Change-Id: I8c5518d71c2db0d56af443c97212f5a63a36a545
2016-03-11 10:55:59 +00:00
Dmitry Tantsur e309953a39 Remove hardcoded delay between introspections
We have 2 more workarounds in place for the same problem:
* ironic-inspector has its own delay logic, which is configurable (unlike this)
  and is shared with anyone using inspector, not only this CLI
* puppet-ironic uses dhcp-sequential-ip option to reduce probability of a
  conflict substantially (we can no longer artificially reproduce it)

Change-Id: I4f330541f1a62cb5e7ef3644b326a8ae68e13b4d
2016-03-10 14:22:38 +02:00
Jenkins 47ef665317 Merge "Fix ironic-inspector client usage" 2016-03-04 13:32:52 +00:00
Dmitry Tantsur 5540eb4d88 Fix ironic-inspector client usage
Right now we are using the ironic-inspector-client functions directly with
providing the auth token. This is deprecated in favor of providing the session.
However, inside the OSC plugin the introspection client is already available,
so just use it directly. This patch also stops redefining --inspector-url which
is already defined by ironic-inspector-client.

Change-Id: I9538e32967103f71c2af94077eb1994462a88d18
2016-02-25 14:58:37 +01:00
Ben Nemec 235e3e00ef Refresh node power state at start of loop
When configuring boot on the baremetal nodes, we first do a list
and then iterate over the results.  This can be a minor hassle if
some of the nodes start out in a transitional power state because
the initial list results don't get updated before checking each
subsequent node.  We end up waiting the sleep time unnecessarily
until the node status is refreshed for every node that was in
transition, even though most of them have probably finished by the
time the first one or two do.

Also removes a later call to node.get since it is now
redundant.

Change-Id: I88d4c57167729cbfb24a9c2ca554738a7fbac3ab
2016-02-24 21:51:14 +00:00
Miles Gould 000f67a4c7 Remove tripleoclient.baremetal wrapper
The Ironic client now supports the OSC plugin interface directly, so
this wrapper is no longer needed. Removing it will allow us to specify
which Ironic API version to use via the standard mechanisms.

Change-Id: If92855c307ecd389fbe6050e426d0ced959a9665
Depends-On: Icdbd28c487351af6d67205837aa536aedb31b41a
2016-02-09 12:36:19 +00:00
Dmitry Tantsur 5ece838dc0 Support new ironic "enroll" state
This state was introduced in Liberty as a new state for freshly
enrolled node. Transition from it is done by the same verb "manage",
but now involves validation of power credentials.

This commit also

 - makes utils.wait_for_provision_state raise appropriate exceptions on
   error rather than returning False
 - adds a utils.nodes_in_states function to list baremetal nodes in a
   given set of states.
 - adds logic to baremetal/fakes.py to track states of fake nodes; this
   is much simpler and less brittle than precisely mocking the results of
   API calls in exactly the order the library code makes them.
 - consistently mocks bulk introspection tests at the client layer,
   rather than at a variety of layers.
 - adds tests for timeout and power-credential error during bulk
   introspection.
 - doesn't set nodes to "available" if they fail introspection or power
   credentials

Change-Id: I4da61491f60f7ebd42ca1f8fe45c3d4df6e49887
2015-12-21 15:51:50 +00:00
Dmitry Tantsur ad470c343e Fail the introspection command if introspection has failed
Currently it only prints an error message, but exists with success.
This makes it impossible to use this command in any kind of automated
scripts or test it in our gate. This patch makes it raise an exception.

Change-Id: I150c87252a48a8062aa7ef04c7a52433dd5ee37d
2015-12-04 14:03:15 +01:00
Dmitry Tantsur 6c5ce78479 Do not try to introspect nodes in maintenance mode and associated ones
Some time ago ironic-discoverd used to require maintenance mode.
This was changed back in Kilo, and was deprecated in Liberty.

Also cleans up introspection code a bit.

Change-Id: Ib2ea84a8e7f0a42423199cd1db40136ab8495fdc
2015-11-10 14:15:16 +01:00
Brad P. Crochet f3af5c5c1c Turn the baremetal client reference into a property
Use a property instead of a function. This is more in line with how the
clients are referenced with openstackclient, thereby making it easier
to switch to the Ironic OSC plugin in the future.

Change-Id: I0b4d35f0af6136dd1bce6c6d4202caa52f4c042e
2015-10-27 12:31:54 +00:00
Jenkins e0778e0ad3 Merge "Add image name option to bm boot config" 2015-09-23 11:56:37 +00:00
John Trowbridge 7fee678947 Refactor for discoverd rename to inspector
The ironic-discoverd project was renamed to
ironic-inspector in liberty.

Change-Id: Id4855d9f4275912440f197f900a59fe5e3bea693
Closes-Bug: 1496937
2015-09-18 13:15:07 -04:00
Marek Aufart 57ce8fad01 Add image name option to bm boot config
In order to be able configure bm deploy with various images,
option --deploy-kernel and --deploy-ramdisk were added to baremetal boot
config command.

Change-Id: I43a7de21f965bc344a9eea20b289182c875b6a83
Closes-Bug: rhbz#1249836
2015-09-18 12:00:53 +00:00
Brad P. Crochet 12edde8a53 Rename rdomanager_oscplugin to tripleoclient
Change-Id: I4593a5248160204645d567d7f2fa3a396629082b
2015-09-08 10:22:22 -04:00