1951 Commits

Author SHA1 Message Date
Pavlo Shchelokovskyy
c79de8a90b Paginate over usage list to return all usages
since nova api 2.40 the os-simple-tenant-usage API supports pagination
and will by default return a number of entities configured internally in
Nova.
This means that when there are many enough projects,
the single call to usage.list() will not return usages for all projects.

This patch effectively copy-pastes the logic to paginate over usage list
results from novaclient/v2/shell.py code.

Change-Id: I1b639fe386b7b7db3223f6965495094b9d51533a
Story: #2005099
Task: #29713
2019-02-28 20:27:04 +02:00
Dean Troyer
1a0bef2b46 More state handling in volume transfer requests functional tests
Using addCleanup() for removing the pending volume transfer request
has no way to wait for the volume status to become available before
cleaning up the volume and gets racy when the tests are run with
slow performance in the volume backend.  So we pause at the end of
the test after either accepting the transfer request or explicitly
deleting it so the cleanup can delete the volume.

Change-Id: I04862069cab28bc76eeafd60ba32be646f478d86
Signed-off-by: Dean Troyer <dtroyer@gmail.com>
2019-02-06 15:40:25 -06:00
Zuul
dd1118e966 Merge "Add floating IP filter to floating IP list command" 2019-01-15 07:48:25 +00:00
Johannes Kulik
b8438adbbf Add floating IP filter to floating IP list command
Add a parameter ``--floating-ip-address`` to ``floating ip list``
because it's supported by the API and also more efficient than the
current ``floating ip show``. This also works as a work-around for
pagination issues ``floating ip show`` might run into with an IP
parameter.

Change-Id: I113e3fa2495e1e86bb553c55c44f71a3f9f49d23
2019-01-14 10:27:07 +01:00
Monty Taylor
2dd5393167
Use os-cloud instead of OS env vars for functional tests
In order to support switching auth contexts, such as for registered_limits
which take a system scoped token, switch the functional tests to using
the --os-cloud command line parameter. However, honor the OS_CLOUD env var
as a way that someone can select a different cloud, including 'envvars',
to use.

Use devstack-system-admin cloud for limit tests

Keystone requires these to have system scope now.

Change-Id: Ia81eebd3e00ae986cf3ba7e3d98f3e8a1647b622
2019-01-10 14:21:03 +00:00
Zuul
7b72fb816f Merge "Support enable/disable uplink status propagation" 2018-12-24 12:00:03 +00:00
Dean Troyer
f9df3ce3cd More volume functional test fixes
Remove the use of class setup/teardown from volume transfer functional tests
as that just doesn't work too well here. Also wait for volume status before
attempting transfer request operations, some test nodes take a while to
create the volumes.

Change-Id: Ib9378ab5c973deb2aa86c9b9ed31408f3a05115a
Signed-off-by: Dean Troyer <dtroyer@gmail.com>
2018-12-18 22:32:16 -06:00
Zuul
235999b995 Merge "Supports router gateway IP QoS" 2018-12-12 13:07:29 +00:00
Zuul
955f22314a Merge "Replace assertEqual(True/False, expr) with assertTrue/assertFalse" 2018-12-12 04:38:19 +00:00
Zuul
6fec6d625f Merge "Don't display router's is_ha and is_distributed attributes always" 2018-12-10 20:09:24 +00:00
LIU Yulong
fd23025227 Supports router gateway IP QoS
Adds --qos-policy and --no-qos-policy to `openstack router set`:
    --qos-policy <qos-policy> Attach QoS policy to router gateway IPs
    --no-qos-policy Remove QoS policy from router gateway IPs

Adds --qos-policy to `openstack router unset`:
  --qos-policy Remove QoS policy from router gateway IPs

Partially-Implements blueprint: router-gateway-ip-qos
Closes-Bug: #1757044
Change-Id: Ifec3b2cf9bdb59513c8bcd7bd60305506a071192
2018-12-10 17:20:38 +00:00
Hongbin Lu
c82f4237e5 Support enable/disable uplink status propagation
Add options to enable/disable uplink status propagation on creating
a neutron port.

Related patches:
* neutron: https://review.openstack.org/#/c/571899/
* openstacksdk: https://review.openstack.org/#/c/586687/

Depends-On: https://review.openstack.org/#/c/586687/
Change-Id: I095a98fc5f5aee62d979a16b3cd79d91ec3b9ddb
Related-Bug: #1722720
2018-12-05 21:07:07 +00:00
liuyamin
5bec3b7e3b Replace assertEqual(True/False, expr) with assertTrue/assertFalse
In some cases, If the result of expr is a boolen value, we shoud
use assertTrue/assertFalse to instead. Because it is clear and simple.

Change-Id: I53b345fc3915a7b0e737e9dd4d58fe09c746d61c
2018-11-14 14:50:05 +08:00
Sean McGinnis
b90c780d2b
Add volume backup import/export commands
This adds commands to import and export volume backup records so they
can be imported and restored on other Cinder instances or to the
original instance if the service or database has been lost and had to be
rebuilt.

I know this is a commonly used process by some users, so it would be
good to have this functionality in osc so they do not have to switch
clients.

More details about the export and import process can be found here:

https://docs.openstack.org/cinder/latest/admin/blockstorage-volume-backups-export-import.html

Change-Id: Ic95f87b36a416a2b50cb2193fd5759ab59336975
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2018-11-10 02:11:04 -06:00
Zuul
097b45686e Merge "Add project param in LimitList parser" 2018-11-08 23:27:05 +00:00
Zuul
51986b1eae Merge "Remove invalid 'unlock-volume' migration arg" 2018-11-08 19:11:06 +00:00
Zuul
c3a60e1173 Merge "Add --name-lookup-one-by-one option to server list" 2018-11-08 19:07:02 +00:00
Vishakha Agarwal
0d764cdb5a Add project param in LimitList parser
when doing openstack limit list --project xyz_id,
CLI raising error unrecognized arguments, whereas
in api-ref document [1], user can pass project_id
as query param.This addresses the above issue, by
adding param --project in parser of LimitList.

[1] https://developer.openstack.org/api-ref/identity/v3/index.html

Change-Id: If4644cc99a3803f61f4a688b828aeb73977fc0dd
Closes-Bug: #1798744
2018-11-08 11:19:24 -06:00
melanie witt
013c9a4f3a Handle multiple ports in AddFloatingIP
AddFloatingIP refers to an old nova proxy API to neutron that was
deprecated in nova. The neutron API for floating IP associate requires
a port to be specified. Currently, the code is selecting the first port
if the server has multiple ports. But, an attempt to associate the
first port with a floating IP can fail if the first port is not on a
network that is attached to an external gateway.

In order to make the command work better for users who have a server
with multiple ports, we can:

  1. Select the port corresponding to the fixed_ip_address, if one was
     specified

  2. Try to associate the floating IP with each port until one of the
     attempts succeeds, else re-raise the last exception.
     (404 ExternalGatewayForFloatingIPNotFound from neutron)

This also fixes incorrect FakeFloatingIP attributes that were being set
in the TestServerAddFloatingIPNetwork unit tests, which were causing
the tests to use None as parsed args for ip-address and
--fixed-ip-address and thus bypassing code in the
'if parsed_args.fixed_ip_address:' block.

Task: 27800
Story: 2004263

Change-Id: I11fbcebf6b00f12a030b000c84dcf1d6b5e86250
2018-11-06 20:18:13 +00:00
Zuul
1894a3cb17 Merge "Add --key-name and --key-unset option for server rebuild API." 2018-11-02 19:41:24 +00:00
Zuul
9ab8143179 Merge "Address issues from volume backend commands" 2018-11-02 18:00:32 +00:00
Pavlo Shchelokovskyy
e782f49927 Add --name-lookup-one-by-one option to server list
usually in a big cloud there are many images and flavors,
while each given project might use only some of those.

This patch introduces '--name-lookup-one-by-one' argument to
server list command (mutually exclusive with '--no-name-lookup')

When provided (or either '--image' or '--flavor' is specified) to the
`server list` command, name resolving for
corresponding entity is now using targeted GET commands instead of
full entities list.

In some situations this can significantly speedup the execution of the
`server list` command by reducing the number of API requests performed.

Change-Id: I59cbf3f75c55e5d3747654edcc9be86ad954cf40
Story: #2002039
Task: #19682
2018-11-02 12:01:36 -05:00
Sean McGinnis
f00ffebea6
Remove invalid 'unlock-volume' migration arg
There is an optional flag that can be passed in to a
volume migration to tell Cinder to 'lock' a volume so
no other process can abort the migration. This is
reflected correctly with the --lock-volume argument
flag to `openstack volume migrate`, but there is
another --unlock-volume flag that is shown in the help
text for this command that does not do anything and is
not used anywhere.

Since there is no action to "unlock" a volume, this
just causes confusion - including for Cinder developers
that know this API. To avoid confusion, this invalid
flag should just be removed from the command.

Change-Id: I5f111ed58803a1bf5d34e828341d735099247108
2018-10-26 12:02:58 -05:00
Zuul
0fa3c84b4f Merge "Default --nic to 'auto' if creating a server with >= 2.37" 2018-10-26 03:20:17 +00:00
Zuul
02f492ae4c Merge "Handle not having cinderclient.v1 available" 2018-10-15 22:07:43 +00:00
Zuul
c19aee4c70 Merge "Allow endpoint filtering on both project and project-domain" 2018-10-12 22:41:46 +00:00
Zuul
ac9877de46 Merge "Add volume backend pool list command" 2018-10-12 22:41:43 +00:00
Zuul
5ad925b600 Merge "Add volume backend capability show command" 2018-10-12 22:41:41 +00:00
Sean McGinnis
e0615e8d69
Address issues from volume backend commands
This fixes some minor issues in release notes and the command list for
the new volume backend commands.

Also sorts the fakes used for volume unit tests to allow for multiple
command update patches to hopefully reduce the odds of merge conflicts.

Change-Id: Ic6e40f4c639368338cf085c68c17038f81da5361
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2018-10-12 15:54:02 -05:00
Sean McGinnis
651f0c38a1
Handle not having cinderclient.v1 available
The Cinder v1 API was deprecated several years ago and may be removed
from python-cinderclient in the near future. To handle the case where v1
is no longer present, this updates cinderclient initialization to work
without it and give an appropriate error if v1 is requested with a
version where it is no longer available.

Change-Id: I277d7b48b8ad4cce383ec3722f8117938378f615
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2018-10-12 14:19:51 -05:00
Sean McGinnis
9647d43bd5
Add volume backend pool list command
Adds an equivalent for "cinder get-pools" with "volume backend pool list"
and "cinder get-pools --detail" with "volume backend pool list --long".

Story: 1655624
Task: 136949

Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
Change-Id: I826c9946ffe11340d44ad57914f72fc2a72b6938
2018-10-09 15:56:58 -05:00
Sean McGinnis
4039d0d94f
Add volume backend capability show command
Adds and equivalend for "cinder get-capabilities" command to show the
capabilities supported by a Cinder backend.

Story: 1655624
Task: 26947

Change-Id: I38686a26cd503e45ce0102705a6632994ef10274
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2018-10-09 15:31:35 -05:00
Julie Pichon
91a2d88862 Allow endpoint filtering on both project and project-domain
The --project and --project-domain flags are currently mutually
exclusive for listing endpoints, however the --project-domain argument
is supposed to help with filtering projects with colliding names. They
should be allowed together.

Story: 2004018
Task: 27007
Change-Id: I7340e01f509e3515f07cb46f175fb603f1ce8b67
2018-10-09 13:23:49 +00:00
Fan Zhang
f82c5b85ce Add --key-name and --key-unset option for server rebuild API.
Change-Id: I6d4793a8e961080ea1d6d414cef8d6bbed0c53e7
Story: 2002609
Task: 22228
Signed-off-by: Fan Zhang <zh.f@outlook.com>
2018-10-09 14:34:44 +08:00
Ruby Loo
e3dc30fe8c Add --property option to 'server rebuild' command
Add '--property' option to the 'server rebuild' command, to provide
the ability to specify properties of the rebuilt instance.

This is equivalent to the '--meta' option of the compute's
'nova rebuild' command.

Change-Id: I25ea6622e970416090109316e1e28fab8b0b3f07
Story: #2003979
Task: #26922
2018-10-05 16:33:48 -04:00
Julie Pichon
1b66ad9067 Fix 'project purge' deleting wrong project's servers and volumes
Project purge would delete the servers and volumes for the project the
user is currently authenticated for, regardless of the --project flag.

Note: This change means that no server at all will be deleted if the
logged in user doesn't have the get_all_tenants permission set in the
Nova policy (default: admin_api). This doesn't appear to be an issue
with Cinder as the default rule appears to be admin_or_owner.

Change-Id: If1c54e24e1482438b81c3c32fd5fc9fdd7a7be04
Story: 1747988
Task: 13854
2018-09-14 10:23:14 +01:00
Alan Bishop
030fd71390 Deprecate volume create --project and --user options
Cinder's volume create API does not support overriding the project_id and
user_id, and it silently igores those API inputs. Cinder always uses the
project and user info in the keystone identity associated with the API
request.

If a user specifies the --project or --user option, the volume create is
aborted and a CommandError exception is raised. This prevents a volume
from being created, but without the desired project/user values.

A user wishing to specify alternate values can still do so using identity
overrides (e.g. --os-username, --os-project-id).

Story: 2002583
Task: 22192
Change-Id: Ia9f910ea1b0e61797e8c8c463fa28e7390f15bf9
2018-08-10 10:20:34 -04:00
Zuul
a051bda111 Merge "Add DNS support to floating IP commands" 2018-08-08 20:15:07 +00:00
Zuul
c387f83af1 Merge "Add dns-domain support to Network object" 2018-08-07 22:10:41 +00:00
Fan Zhang
def83a0e94 Fix broken gate jobs
This patch aims at fixing the broken gate jobs because of
cinder and glance patches [1], [2], [3] and [4].

* Remove parameter `--source-replicated` to drop volume
  replication v1 support
* Address some timing issues with volume transfer requests
* Only run Image v1 tests when the test cloud has v1 available
* Get tolerant of unexpected additional attributes being
  returned in Image data

[1].https://review.openstack.org/#/c/586293/
[2].https://review.openstack.org/#/c/532503/
[3].https://review.openstack.org/#/c/533564/
[4].https://review.openstack.org/#/c/578755/

Co-Authored-By: Dean Troyer <dtroyer@gmail.com>
Co-Authored-By: Monty Taylor <mordred@inaugust.com>
Depends-on: https://review.openstack.org/588664
Change-Id: I2a785750e92155185d3344e6116c7f5c6fdd3cbe
Signed-off-by: Fan Zhang <zh.f@outlook.com>
2018-08-07 09:32:00 +00:00
Jens Harbott
ed09f28a9d Add DNS support to floating IP commands
Add the DNS domain and name options to the ``floating ip create``
command. Also add these two columns to the output of the
``floating ip list --long`` command.

Change-Id: Id4cb18b51b252f19b87b24ec5d77183771189d17
Story: 1547736
Task: 13114
2018-08-06 08:14:48 +00:00
Zuul
c056780691 Merge "Don't sent disk_over_commit if nova api > 2.24" 2018-07-25 19:31:35 +00:00
Zuul
7ae49c5b02 Merge "Add command to show all service versions" 2018-07-25 17:57:44 +00:00
Zuul
cc037e22a6 Merge "Support --community in openstack image list" 2018-07-25 02:49:02 +00:00
Zuul
6469d86522 Merge "Implement support for project limits" 2018-07-25 00:52:42 +00:00
Zuul
d177727a6e Merge "Implement support for registered limits" 2018-07-25 00:52:41 +00:00
Zuul
e78a2e7b09 Merge "compute: host: expand kwargs in host_set() call" 2018-07-25 00:52:39 +00:00
Zuul
d838c69605 Merge "Support filtering port with IP address substring" 2018-07-25 00:42:32 +00:00
Nobuto Murata
860639a548 Support --community in openstack image list
"--community" was added to "image create" and "image set" previously,
but was missed in "image list".

Change-Id: I959fdd7f67ae62c8326659ce52389228152ec019
Story: 2001925
Task: 14453
2018-07-24 22:48:01 +00:00
Zuul
c42b8552a8 Merge "Fix error with image show when image name is None" 2018-07-24 21:45:26 +00:00