210 Commits

Author SHA1 Message Date
Stephen Finucane
fcdc61a18a doc: Don't use single backticks in man pages
This is done in a couple of places in the documentation and is broken
rST. 'prog' is semantic markup that fits right in here, so use that.

Change-Id: Ic654e33daaf68b01f561ac8d792934d5a57a07e5
2018-05-03 10:48:43 +01:00
Zuul
d079d26444 Merge "Log a warning and add nova-status check for old API service versions" 2018-04-20 05:21:00 +00:00
Surya Seetharaman
441a637771 Cleanup patch for the cell-disable series
This patch addresses the cleanup comments from the reviewers
for the cell-disable spec series.

Change-Id: I9e6e9518ca380b497f411dd01fed85562dd2731c
2018-04-13 10:03:53 +02:00
Zuul
7891acf809 Merge "Marker reset option for nova-manage map_instances" 2018-04-11 17:57:04 +00:00
Matt Riedemann
eaf6340847 Log a warning and add nova-status check for old API service versions
Change Ib984c30543acb3ca9cb95fb53d44d9ded0f5a5c8, which was added
in Newton when cells v2 was optional, added some transitional code
to the API for looking up an instance, which didn't rely on instance
mappings in a cell to find the instance if the minimum nova-osapi_compute
service version was from before Ocata.

People have reported this being a source of confusion when upgrading
from before Ocata, when cells v2 wasn't required, to Ocata+ where cells
v2 along with the mapping setup is required. That's because they might
have older nova-osapi_compute service version records in their 'nova'
(cell) database which makes the API think the code is older than it
actually is, and results in an InstanceNotFound error.

This change does two things:

1. Adds a warning to the compute API code in this scenario to serve
   as a breadcrumb if a deployment hits this issue.

2. A nova-status check to look for minimum nova-osapi_compute service
   versions across all cells and report the issue as a warning. It's
   not an upgrade failure since we don't know how the nova-api service
   is configured, but leave that investigation up to the deployer.

This is also written in such a way that we should be able to backport
this through to stable/ocata.

Change-Id: Ie2bc4616439352850cf29a9de7d33a06c8f7c2b8
Closes-Bug: #1759316
2018-04-09 14:43:34 -04:00
Zuul
0120643def Merge "Add --enable and --disable options to nova-manage update_cell" 2018-04-05 23:16:13 +00:00
Matt Riedemann
7eb6703521 Add nova-status check for ironic flavor migration
In Pike we started requiring that ironic instances have their
embedded flavor migrated to track the ironic node custom
resource class. This can be done either via the normal running
of the nova-compute service and ironic driver or via the
'nova-manage db ironic_flavor_migration' command.

This change adds a nova-status check to see if there are any
unmigrated ironic instances across all non-cell0 cells, and
is based mostly on the same logic within the nova-manage command
except it's multi-cell aware and doesn't use the objects.

Change-Id: Ifd22325e849db2353b1b1eedfe998e3d6a79591c
2018-04-04 17:23:06 -04:00
Surya Seetharaman
cd01cbe65e Add --enable and --disable options to nova-manage update_cell
Through these new options, users can enable or disable a cell
through the CLI.

Related to blueprint cell-disable

Change-Id: I761f2e2b1f1cc2c605f7da504a8c8647d6d6a45e
2018-04-04 20:23:51 +00:00
Dan Smith
a9e7581f00 Make get_allocation_candidates() honor aggregate restrictions
This uses the member_of query parameter to placement to ensure that the
candidates returned are within the appropriate aggregate(s) if so
specified.

Related to blueprint placement-req-filter

Change-Id: If8ac06039ac9d647efdc088fbe944938e205e941
2018-03-28 15:58:45 -07:00
Zuul
9c7ebf90fa Merge "Add disabled option to create_cell command" 2018-03-26 13:26:35 +00:00
Zuul
7672472998 Merge "Modify nova-manage cell_v2 list_cells to display "disabled" column" 2018-03-26 13:11:28 +00:00
Surya Seetharaman
2e491f7490 Modify nova-manage cell_v2 list_cells to display "disabled" column
This patch adds the new column disabled to the list of columns to be
displayed by the list_cells command.

Related to blueprint cell-disable

Change-Id: I96a6d5e59d33c65314fc187c0286ce3408d30bdc
2018-03-23 20:26:22 +00:00
Surya Seetharaman
9e9520a4b0 Add disabled option to create_cell command
Specifying this new option will create pre-disabled cells.

Related to blueprint cell-disable

Change-Id: I87e06eeefd48f640f42fcc5ff5a48938adc2ac22
2018-03-23 20:26:02 +00:00
Zuul
658d468df4 Merge "Remove version/date from CLI documentation" 2018-03-20 00:05:03 +00:00
Ken'ichi Ohmichi
d6be2ece51 Remove version/date from CLI documentation
This patch removes the unnecessary maintenance of a date and version
from the CLI documentation.

NOTE: Cinder team also did the same removal with
      the commit Idf78bbed44f942bb6976ccf4da67c748d9283ed9

Change-Id: I0a9dd49e68f2d47c58a46b107c77975e7b2aeaf7
2018-03-19 17:03:02 +00:00
Zuul
37b4f77b5e Merge "Add --by-service to discover_hosts" 2018-03-19 05:07:53 +00:00
Zuul
15885f18c8 Merge "Make archive_deleted_rows handle a missing CONF.api_database.connection" 2018-03-18 02:16:29 +00:00
Dan Smith
005a66d7e0 Add --by-service to discover_hosts
This allows us to discover and map compute hosts by service instead of
by compute node, which will solve a major deployment ordering problem for
people using ironic. This also allows closing a really nasty race when
doing HA of nova-compute/ironic.

Change-Id: Ie9f064cb9caf6dcba2414acb24d12b825df45fab
Closes-Bug: #1755602
2018-03-16 15:55:19 -07:00
Surya Seetharaman
98163f98b7 Marker reset option for nova-manage map_instances
Currently nova-manage map_instances uses a marker set-up by which repeated
runs of the command will start from where the last run finished. Even
deleting the cell with the instance_mappings will not remove the marker
since the marker mapping has a NULL cell_mapping field. There needs to be
a way to reset this marker so that the user can run map_instances from the
beginning instead of the map_instances command saying "all instances are
already mapped" as is the current behavior.

Change-Id: Ic9a0bda9314cc1caed993db101bf6f874c0a0ae8
Closes-Bug: #1745358
2018-03-15 10:28:57 +01:00
Surya Seetharaman
8da6831e63 Make archive_deleted_rows handle a missing CONF.api_database.connection
This change https://review.openstack.org/#/c/515034/ (added in queens)
makes the archive_deleted_rows CLI remove instance mappings and request
specs from the API database if there are instances archived from the
main nova/cell database. However for this to work, the api database
connection should be set in the config file. So in the case that the
API database is not configured in the config file being used to run the
CLI, we should gracefully handle the condition and and stop archiving thus
prompting the user to set the api_db config and try the archival operation
again. This patch fixes the graceful handling.

Change-Id: I0c7b802a453aa423c7273ab724ce78eac0cfed4c
Closes-Bug: #1753833
2018-03-13 18:52:41 +01:00
David Rabel
fcda5c2d1a Fix indentation in doc/source/cli/*
Current indentation was wrongly interpreted as quotes.

Change-Id: I731d8833e69e6bed12f5637d6bb3248b890c18ab
2018-03-09 15:41:00 +00:00
Dan Smith
fd59fbd4d1 Make nova-manage db purge take --all-cells
This makes purge iterate over all cells if requested. This also makes our
post_test_hook.sh use the --all-cells variant with just the base config
file.

Related to blueprint purge-db

Change-Id: I7eb5ed05224838cdba18e96724162cc930f4422e
2018-03-08 09:26:49 -08:00
Dan Smith
ff47787e11 Add --purge helper flag to archive_deleted_rows
Since many people will want to fully purge shadow table data after archiving,
this adds a --purge flag to archive_deleted_rows which will automatically do
a full db purge when complete.

Related to blueprint purge-db

Change-Id: Ibd824a77b32cbceb60973a89a93ce09fe6d1050d
2018-03-08 09:17:22 -08:00
Zuul
83caaae547 Merge "Add simple db purge command" 2018-03-08 17:15:22 +00:00
Surya Seetharaman
00a0308d2a Update the nova-manage db archive_deleted_rows description
This patch adds the bit about removing the deleted rows from the
instance_mappings and request_specs tables as well permanently so
that the users are aware of this.

Change-Id: I183cc9f80b3feec6789332860b5aeb7591b710df
2018-03-08 00:29:39 +01:00
Dan Smith
ae241cc68f Add simple db purge command
This adds a simple purge command to nova-manage. It either deletes all
shadow archived data, or data older than a date if provided.

This also adds a post-test hook to run purge after archive to validate
that it at least works on data generated by a gate run.

Related to blueprint purge-db

Change-Id: I6f87cf03d49be6bfad2c5e6f0c8accf0fab4e6ee
2018-03-07 10:35:32 -08:00
Zuul
a32e22d005 Merge "Extending delete_cell --force to delete instance_mappings" 2018-02-22 20:47:17 +00:00
Surya Seetharaman
ee2f65d91f Extending delete_cell --force to delete instance_mappings
Currently the nova-manage delete_cell command with the --force option
allows us to destroy hosts_mappings of the cell which does not have any
instances or instance_mappings. This patch extends this command with the
--force option for destroying instance_mappings in addition to the
host_mappings of the cell which is to be deleted. Note that the instance
mappings and host mappings are only removed if there are no living
instances in the cell. So a --force delete here will not work if there
are non-deleted instances.

Change-Id: Ibefa0465224bec9a22431c7d3b5c8f5d91fc7732
Closes-Bug: #1745375
2018-02-20 11:17:13 +01:00
Zuul
538f47eeca Merge "add "--until-complete" option for nova-manage db archive_deleted_rows." 2018-02-01 21:26:11 +00:00
Zuul
40f74fb959 Merge "placement: enable required traits from the flavor extra specs" 2018-02-01 06:42:41 +00:00
Ameed Ashour
eba33a0e2d add "--until-complete" option for nova-manage db archive_deleted_rows.
Change-Id: Ibcb489efb364c03167b7398f615c9a15f6867370
Closes-bug: #1746531
2018-01-31 16:45:24 -05:00
He Jie Xu
6a818ebc19 placement: enable required traits from the flavor extra specs
This patch enables the flavor extra spec 'required:[traits]'. The
admin can specifiy a set of traits that a flavor required.

To enable this, the placement 1.17 is required, it added trait
support in the `GET /allocation_candidates` API. So bump the
minimal placement version requirement to 1.17 and update the
check in cmd `nova-status`.

Implement blueprint request-traits-in-nova

Change-Id: Ia51ace951e9a0402f873ce9751a8cd3c0283db08
2018-01-24 23:35:54 +08:00
Matt Riedemann
2890d8db67 Expand on when you might want to set --max-count for map_instances
The default behavior for the "nova-manage cell_v2 map_instances"
command is to map all instances in the cell in batches of 50.

This can be slow when there are several thousand instances in the
deployment and an operator may want to specify a higher --max-count
value and run the command until it completes.

This simply updates the command option description and man page to
point this out for consideration.

Change-Id: I59c2ed89fe02212977445f6825c6da8fedbb8ccf
Related-Bug: #1742649
2018-01-23 15:34:03 -05:00
Zuul
d9ba29fd6e Merge "update_cell allows more than once cell to have the same db/transport url" 2018-01-16 11:12:03 +00:00
Takashi NATSUME
52e7e6e3e4 Add a warning in 'nova-manage cell_v2 delete_cell'
When deleting a cell, if there are instance mappings to the cell,
the command fails with the following message.

* There are existing instances mapped to cell with uuid UUID.

But even if all instances have been deleted in the cell,
the same message is shown.

So in that case, add a warning that the instance mappings have to
be deleted by 'nova-manage db archive_deleted_rows'
before deleting the cell.

Change-Id: I2a163fb50a7e71ce9f463bc9ddeffe2ea47d1588
Closes-Bug: #1725331
2018-01-12 07:22:32 +00:00
Zuul
0010e230cc Merge "Add support for listing hosts in cellv2" 2018-01-03 23:19:40 +00:00
jichenjc
38a8a142a3 Remove 'nova-manage logs' command
This command was deprecated in 16.0.0 and can now be removed.

Change-Id: I980352415a2d812725d53d46eb968abbf443b6b7
2017-12-27 14:58:28 +00:00
Zuul
c864cf677f Merge "Remove 'nova-manage account' and 'nova-manage project'" 2017-12-27 13:43:59 +00:00
Zuul
024ebdccb5 Merge "Update nova-status and docs for nova-compute requiring placement 1.14" 2017-12-19 22:23:47 +00:00
Surya Seetharaman
c34e37eef3 update_cell allows more than once cell to have the same db/transport url
Unlike in nova-manage create_cell, in nova-manage update_cell the check
for the same combination of transport-url and/or database_connection
does not exist. Hence it allows a user to update a cell's transport-url
and/or database_connection to another existing cell's transport/db urls.

Change-Id: Ia5d5566c535d6da3d215392590a2d362e1226424
Closes-Bug: #1729806
2017-12-18 11:10:57 +01:00
Matt Riedemann
4b7a150584 Update nova-status and docs for nova-compute requiring placement 1.14
With change I2f367b06e683ed7c815dd9e0536a46e5f0a27e6c, nova-compute
now unconditionally requires Placement 1.14 to be available (the
client side code doesn't check to see if 1.14 is available before
trying to use it).

This change updates the nova-status check for the minimum required
version of Placement and also starts the "Queens" section of the
Placement upgrade notes docs.

Change-Id: I37415e384d375bc9b548a0223f787a9236286bb0
2017-12-13 15:18:27 -05:00
Hongbin Lu
c7b51a63b0 Add support for listing hosts in cellv2
Add a ``nova-manage cell_v2 list_hosts`` command for listing hosts
in one or all v2 cells.

Change-Id: Ie8eaa8701aafac10e030568107b8e6255a60434d
Closes-Bug: #1735687
2017-12-07 23:38:47 +00:00
jichenjc
b9b78fc252 Remove 'nova-manage account' and 'nova-manage project'
These commands were deprecated in 16.0.0 and can now be removed.

Change-Id: Icab97d0f46ab83b1f8584fd1d8c482e6d04a8795
2017-12-04 10:47:49 +08:00
jichenjc
726387e51a Remove 'nova-manage shell' command
This command was deprecated in 16.0.0 and can be removed.

Change-Id: I29c9e437fb7a99b0ecbd4ebda1518dd49d414e96
2017-12-04 10:46:40 +08:00
jichenjc
d614a8b8af Remove 'nova-manage quota refresh' command
This command was deprecated in 16.0.0 and can now be removed.

Change-Id: I016227cb20f8d6911e3cb57c7372835a75d122fd
2017-11-24 02:34:47 +08:00
Surya Seetharaman
32fd58813f cleanup mapping/reqspec after archive instance
This patch aims at deleting the records of the archived instances from
the instance_mappings and request_specs tables in the API database
immediately following their archival from instances to shadow_instances
table. So upon running the 'nova-manage db archive_deleted_rows' command
the records of the archived instances will be automatically removed from
the instance_mappings and request_specs tables as well. A warning has
also been added to fix the issue of 'nova-manage verify_instance'
returning a valid instance mapping even after the instance is deleted.

The patch also adds InstanceMappingList.destory_bulk() and
RequestSpec.destroy_bulk() methods for ease of bulk deletion of records.

Change-Id: I483701a55576c245d091ff086b32081b392f746e
Closes-Bug: #1724621
Closes-Bug: #1678056
2017-11-21 15:28:07 +01:00
Michael Still
3f7995f586 Move the idmapshift binary into privsep.
I can't see any evidence that anyone else uses our nova-idmapshift
binary, and it adds a lot of complexity (flags we never call for
example). Move the code we do actually use into the privsep
directory and simplify our calls to it. Remove the extra binary
from our install and documentation.

Change-Id: Ibce28d20d166da154833376cf51f1877b829925e
blueprint: hurrah-for-privsep
2017-10-24 18:50:23 +11:00
Takashi NATSUME
f4f17b364e Add 'delete_host' command in 'nova-manage cell_v2'
Add 'delete_host' command in 'nova-manage cell_v2'.
Add an optional 'force' option in 'nova-manage cell_v2 delete_cell'.
If specifying the 'force' option, a cell can be deleted
even if the cell has hosts.

Change-Id: I8cd7826c2c03687c6b85731519778f09d542b236
Closes-Bug: #1721179
2017-10-19 01:31:02 +00:00
Stephen Finucane
3a6e1e2396 doc: Rework man pages
Rework the man pages by:

- Wording the synopsis sections similarly for all commands
- Not using upper-case section names, as this is unnecessary and results
  in worse HTML output
- Formatting code and file names as literals

The 'nova-idmapshift' man page is excluded as this utility will be
removed shortly.

Change-Id: I67914a757f9436461960a8d6b92d157f59ccad66
2017-10-09 16:08:40 +01:00
Takashi NATSUME
48eb371e62 Fix inconsistency of 'NOTE:' description
Use the 'note' directive.

TrivialFix
Change-Id: If342940f8cc64591778ad21ce6cccbe006c0145b
2017-09-28 16:28:49 +09:00