Commit Graph

20 Commits

Author SHA1 Message Date
Okeke Christian 23de7b4b0c Add delete CLI helper to ShareCommands
This patch adds a delete cli command to ShareCommands
The helper CLI command checks if service if up. If service
is down, it deletes the share instance

Closes-Bug: #1867030
Change-Id: I6a0575c1ed86213010e50fe1b7a733cdf7fa1736
2024-04-05 16:08:55 +01:00
Felipe Rodrigues 2b57d15c64 Add multiple subnets per AZ support
Manila can now configure a share network with multiple subnets
in an availability zone. Also, it can add a new subnet for an
availability that has share servers, which will triger an update
share server allocations.

Changes:
- API:
  - Bump version to 2.70.
  - setup share network with multiple subents per az.
  - Block manage server with multiple subnets.
  - Allow add subnet for in-use share servers.
  - `share_network_subnet_id` is dropped from ShareServer view
  - `share_network_subnet_ids` is added in ShareServer view
  - `network_allocation_update_support` is added to ShareServer and
    ShareNetwork views.
  - Add a check operation for share network subnet create.

- DB:
  - Remove `share_network_subnet_id` from share_servers.
  - Create mapping table `share_server_share_network_subnet_mappings`.
  - Fix queries with new db design.
  - Add migration downgrade and upgrade alembic.
  - Add `share_network_subnet_id` to the NetworkAllocations.

- Scheduler:
  - Change `AvailabilityZoneFilter` to take in account if the
    host supports the allocation required by the setup request.

- Manager:
  - Bump RPC API version.
  - `_setup_server` allocating multiple subnets.
  - Modify signature of driver `_setup_server` interface, passing a
    list of `network_info` for each subnet.
  - Share server DB creation to inform a list of subnets and
    create with `network_allocation_update_support`.
  - Implement `check_update_share_server_network_allocations` and
    `update_share_server_network_allocations`.

- Drivers:
  - For legacy compatibility, all drivers implementing `_setup_server`
    consume the first element of the `network_ino`.
  - Dummy Driver:
    - Implement `_setup_server` with new signature as multiple subnet.
    - Modify the `backend_details` to save allocations for all subnets.
    - Report update allocation and share server multiple subnet support.
    - Implement `check_update_share_server_network_allocations` and
      `update_share_server_network_allocations` interfaces.

Signed-off-by: Felipe Rodrigues <felipefuty01@gmail.com>
Co-Authored-By: Andre Beltrami <debeltrami@gmail.com>
Co-Authored-By: Fábio Oliveira <fabioaurelio1269@gmail.com>
Co-Authored-By: Nahim Alves de Souza <nahimsouza@outlook.com>
Co-Authored-By: Caique Mello <caique_mellosbo@hotmail.com>

DocImpact
APIImpact
Partially-Implements: blueprint multiple-share-network-subnets

Change-Id: I7de9de4ae509182e9494bba604979cce03acceec
2022-03-03 02:31:11 +00:00
Douglas Viroel 75acc51489 Remove unused model properties and increase unit test coverage
This is a follow up patch for [1] which removes some unused model
properties and add more unit tests to increase coverage.

[1] https://review.opendev.org/c/openstack/manila/+/774728

Change-Id: I10af132203cb07cea62839014925c7e4c99499e4
Signed-off-by: Douglas Viroel <viroel@gmail.com>
2021-03-23 09:27:48 -03:00
haixin 3831e5500f remove usage of six library from unit tests
Replace six with Python 3 style code.

Change-Id: I5077e71663f6b60bd774f30fcf64b36d4078cf8e
2021-01-28 10:47:40 +08:00
Goutham Pacha Ravi 370b15b6c6 Modify share groups w/ manila-manage's update-host
We can also condense this code a bit to allow
adding more resources who have a "host" attribute.

Closes-Bug: #1895323
Change-Id: I5b750217e019b7bc5281006f63feba8fa06db534
Signed-off-by: Goutham Pacha Ravi <gouthampravi@gmail.com>
2020-09-11 10:00:41 -07:00
Zuul 3b19c3ff25 Merge "add share server update to manila-manage share update_host" 2020-08-28 18:52:57 +00:00
Maurice Escher 365cfa3516
add share server update to manila-manage share update_host
Change-Id: Ifb19d926a84fae986b8d296959cfce71bf0c2e9e
Closes-Bug: #1881098
2020-07-15 11:37:30 +02:00
Maurice Escher c8a8494c78
add manila-manage service cleanup
Change-Id: I32307d5349c8ead5c0f7846f245d49f36dc3bf19
Closes-Bug: #1881112
2020-06-18 10:06:54 +02:00
Goutham Pacha Ravi 598223985a Use unittest.mock instead of third party lib
mock was adopted into standard python
in version 3.3 [1]. Since manila no longer
supports python2.7, we can use the inbuilt
mock package rather than the third party
lib.

Fix some issues with imports that weren't
following our import conventions of grouping
imports [3]

Add a hacking test to ensure we don't regress
on this.

[1] https://docs.python.org/3/library/unittest.mock.html
[2] http://lists.openstack.org/pipermail/openstack-discuss/2020-March/013281.html
[3] https://docs.openstack.org/hacking/latest/user/hacking.html#imports

Co-Authored-By: Sean McGinnis <sean.mcginnis@gmail.com>
Change-Id: If857a49fbf526983e712282a25d7e8bef5093533
Signed-off-by: Goutham Pacha Ravi <gouthampravi@gmail.com>
2020-04-17 16:24:27 -07:00
Thomas Bechtold 0c177b902a Drop param2id() from cmd/manage.py
The function is not used anywhere.

Change-Id: I799e73992faa387e56a793d60cc599039d268f81
2019-01-03 14:10:01 +01:00
Goutham Pacha Ravi dbf97098e1 Add command to update share instance hosts
usage: manila-manage share update_host --currenthost CURRENTHOST
                                       --newhost NEWHOST
                                        [--force FORCE]
  --currenthost CURRENTHOST  Current share host name.
  --newhost NEWHOST     New share host name.
  --force FORCE         Ignore validations.

A fully qualified host string is of the format
'HostA@BackendB#PoolC'. The command allows making
substring modifications to update the host or the
host and backend. To avoid making gratuitous changes,
the complete host string must be specified.

Change-Id: I0f30ab6135c8c438860341cc68b512311e9c4711
2018-08-23 21:04:35 +00:00
Tom Barron 4e25ce5a0c Remove usage of parameter enforce_type
oslo.config has deprecated the enforce_type parameter to
set_override() and set its default value to True [1],
so remove this usage from our codebase.  Also remove
explict str() cast of mock.sentinel_password in
Windows driver since it should no longer be expected.

[1] Ifa552de0a994e40388cbc9f7dbaa55700ca276b0

Change-Id: Ic02cbb37c6dbf30cacb1e6e290bfb0986f54d5f3
2017-04-16 10:39:01 -04:00
nidhimittalhada c8ff803531 Test: make enforce_type=True in CONF.set_override
Each config option has limitation for type and value. If we use
method CONF.set_override without parameter enforce_type=True, we
may pass wrong type to config option.

This commit makes sure calling method CONF.set_override with
enforce_type=True.

Change-Id: I700dcd21941c6399c51e11bef2282e1e4565e85a
Closes-Bug: #1517839
2016-05-12 11:27:30 +05:30
Yusuke Hayashi d3e50fd70f Fix order of arguments in assertEqual
Fix incorrect order assertEqual(observed, expected) as below.
  assertEqual(observed, expected) => assertEqual(expected, observed)

Target of this patch:
  manila/tests/cmd/*
  manila/tests/compute/*
  manila/db/*
  manila/network/*

Change-Id: I6dd4f8057facc68e716b57229cbc4096af8bb152
Partial-Bug: #1259292
2015-10-03 10:05:41 +09:00
Valeriy Ponomaryov aa7c55ad07 Fix display of availability-zone for manila-manage command
Commands "manila-manage service list" and "manila-manage host list"
were displaying availability zone instance instead of its name.

Such bug appeared after implementation of Availability zone model.
So, fix it by providing 'name' field of availability zone model.

Change-Id: I14c3451380df01853183aed265344b1783c95939
Closes-Bug: #1499677
2015-10-01 09:44:53 +00:00
Jenkins 5973b3a1c9 Merge "Fix imports for py34 compatibility" 2015-08-06 09:51:16 +00:00
Julia Varlamova c3e749dafd Fix imports for py34 compatibility
Fix imports of:
    urllib2
    httplib
    __builtin__
    StringIO
    UserDict

Partially-Implements: bp py3-compatibility

Change-Id: I0da74d504456cbb9680973bdabc091cf8786bc9a
2015-08-05 17:32:13 +03:00
Valeriy Ponomaryov 554b92e458 Fix exceptions handling for py34 compatibility
Fix following cases:

    "except SomeException, e:"
    "raise exc_value, msg, exc_trace"
    "e.message"

Partially-Implements: bp py3-compatibility

Change-Id: I8c20ae725000895b6b7b7c0da7d4bfba3e4849f0
2015-08-05 17:15:46 +03:00
Julia Varlamova a4a60b1328 Use oslo_policy lib instead of oslo-incubator code
Code from manila/openstack/common/policy.py duplicates code
from oslo_policy, so we remove this module and use oslo_policy instead.

Implements bp use-oslo-policy-lib

Change-Id: I289221a1e96f6c705deef4070be113d69c57f6e0
2015-04-21 13:05:42 +03:00
Julia Varlamova b6ab3167dc Use entry_points for manila scripts
Manila scripts located in bin/* should be covered with unit tests.
In order to add unit tests for bin/* scripts:
- all
- api
- manage
- scheduler
- share
we move them into manila/cmd and use pbr to setup console scripts
which will call the respective main function of each script under manila/cmd.
It will allow us to import from manila.cmd and individually test each 'main' function.

Add unit tests for manila/cmd/* scripts.

Implements bp unit-tests-for-manila-scripts

Change-Id: I9be6b948a6de7ba76405411e98d7531cf225b57e
2015-04-14 21:04:01 +03:00