Some of the APIs implemented in manila.compute.nova.API are not used
by any implementation. This change drops unused implementations rather
than keeping them maintained for no use.
Change-Id: I5195c31c6a95ed22eb89d734f3eea6a077eb2f68
Currently images are managed by Glance, instead of Nova, and these
implementations are no longer used.
Change-Id: Iabd4591b6782b135faa137a1e14a1fb760127ee6
Authorization errors when connecting
to nova/glance/neutron/cinder can be raised as
BadConfigurationExceptions in the logs. We shouldn't
be raising exceptions derived from the service client
libraries.
Change-Id: I2d47dbb1251dfa8d529f813724fb7fd97d7d3a0b
Closes-Bug: #1921927
Signed-off-by: Goutham Pacha Ravi <gouthampravi@gmail.com>
Glance image list API supports pagination, but `_get_service_image`
uses novaclient.glance.list() that only return images in one page.
When the image needed by share server is not returned in the first
page, the exception occurs. This patch uses `find_image` method
to get the image.
Since latest novaclient has no proxy to lookup image, so only
novaclient.glance.
Change-Id: I57b15b7ebb29c545c9780a90734988565fa1f6b7
Closes-Bug: #1844046
In the past, the options ca_certificates_file,
nova_ca_certificates_file, cinder_ca_certificates_file,
api_insecure, nova_api_insecure, cinder_api_insecure
were supplied to instantiate nova, neutron and cinder
clients. These options have now been subsumed in a more
generic way into the Keystone session logic as 'cafile'
and 'insecure'. Deprecate the older options in Stein so
that we can remove them in a future release.
This deprecation began many releases ago when we switched
to using keystone sessions [1]. However, we were still
overriding the values of "insecure" and "cafile" if provided,
forcing users to continue using deprecated parameters
"api_insecure" and "ca_certificates_file". So despite
this fix originating in the Stein release, it would be
prudent to backport it to all maintained releases and
remove support for these older options in/beyond Train
release (9.0.0).
[1] Ic211a11308a3295409467efd88bff413482ee58d
Change-Id: I148e9079c7c1ab119f519f727d4ad97758473325
Related-Bug: #1802393
Closes-Bug: #1809318
Cinder, nova, neutron has deprecated some default options
since last release, so it is time to remove those options
in this version. refer to the following deprecation patch.
Ref: https://review.openstack.org/#/c/290511/
Closes-bug: #1766384
Change-Id: I595ff2c82ef40566145fedb202e549be69c45e0c
Novaclient has removed lots of proxies to other clients such as
'images' [1], 'networks' [2] and 'security_groups' [3].
So, fix incompatibilities the way we can work with old and
new novaclient versions.
[1] I2d9fd0243d42538bd1417a42357c17b09368d2a5
[2] I8c520100a0016eed3959619c71dae037ebd72939
[3] I6fa14f43d48f1e035ef54bd2d0078506f0c6d6e0
Change-Id: Id7383329b2491f76579f042cbed06585c2214815
Closes-Bug: #1691445
Since change [1] it is impossible to set endpoint_type and region_name
for nova, cinder and neutron clients that are used by manila in some
cases.
So, to fix it, add additional options called 'endpoint_type' and
'region_name' for each of config groups related to these clients.
These options can be defined in appropriate config group as following:
[nova]
endpoint_type = publicURL
region_name = SomeRegionName
[cinder]
endpoint_type = internalURL
region_name = SomeRegionName
[neutron]
endpoint_type = adminURL
region_name = SomeRegionName
[1] Ic211a11308a3295409467efd88bff413482ee58d
Change-Id: I6be0e77bbc0e4b1e9905eba7a7b48ff540e9e377
Closes-Bug: #1633454
Using the generic driver needs a service instance. The variable
"service_instance_name_or_id" indicates that it's possible to use
the UUID or the name of the Nova VM. Using the VM name currently only
works, when the instance is in the current tenant.
This fix searches the instance at first in the current tenant and
if not found, it searches again over all tenants.
Without this fix, you get the following error when using the name:
Failed to get Nova VM. No server with a name or ID of 'myname' exists.
Change-Id: I8770eff9752b76ebe490abf03a7ea6548282bf9b
Closes-Bug: #1535775
If Novaclient returns exception, then Manila wrapper for Novaclient
fails with following error:
File "/opt/stack/new/manila/manila/compute/nova.py", line 160, in wrapper
return res
UnboundLocalError: local variable 'res' referenced before assignment
So, fix it and cover with unit tests.
Change-Id: I5eec4b9e9f3857307daa2ade516f76c044c01631
Closes-Bug: #1530811
Some of tests use different method of assertTrue(isinstance(A, B)) or
assertEqual(type(A), B). The correct way is to use assertIsInstance(A,
B) provided by testtools.
Change-Id: I9053c9deaa71ee12e10db73b19250b3a32f3d93c
Closes-bug: #1268480
Replace assertEqual(None, *) with assertIsNone in tests to have
more clear messages in case of failure.
Closes-Bug: #1280522
Change-Id: I2d5285add72678b5a61b4f66879c4d066afc34c7
Currently v1_1 version of novaclient is deprecated, so it's required
to switch for v2 version of novaclient.
Change-Id: I824e8659febfeb86721b610a03a8c3027042cb3d
Share drivers that handle share servers use network plugins to setup networking
for share hosts. And there were no support for nova-networking.
Add two new network plugins, both use Nova networking:
- NovaNetworkPlugin, uses network ID provided by share-networks
- NovaSingleNetworkPlugin, uses network ID defined within config
by opt 'nova_single_network_plugin_net_id'.
Both have same possibilities restricted by Nova networking:
- supported network types: 'flat' and 'vlan'
- supported IP versions: '4' and '6'
- support any amount of IP addresses to be dedicated/provided for share servers
while network has available/unused IP addresses.
Implements bp nova-network-plugin
Change-Id: I6391f168d93107d9152132830afde896aba2180a
Till that moment it was possible to use Generic driver only with Neutron.
Nova network still is used in various deployments, so add support for it.
List of changes:
- Split service_instance to two parts - compute and networking.
- Implement networking part as 'network helpers'.
- Add new config option 'service_instance_network_helper_type' that supports
only two values - 'nova' and 'neutron' respectively.
It is required option. Default value is 'neutron'.
Details on Nova-network approach:
- Due to resctrictions of Nova network, where security group rules are applied
to all VM network interfaces, no need to create service network, because it
will be just duplication. Service instance will use only one network that is
provided within share-network entity.
- Host of manila-share service should have network connectivity for all
networks, that are going to be used for share creations.
- Nova network helper does not create resources, so, network is not configured
by Manila in that case. So, network infrastructure can be either flat or using
VLAN segmentation as well.
Implements BP nova-network-support-in-generic-driver
Implements BP split-service-instance
Change-Id: I7462fe3d6fa944d391628b8e2b374cf5593924ea
The Manila test module uses a class called StubOutForTesting, which
is an awkward holdover from when the unit tests were using Mox.
Alex wrote a more elegant and capable mocker method,
manila.test.TestCase.mock_object, in the Cinder project which we
have now added to Manila. So to remove the duplicate functionality
and legacy code, all references to self.stubs.Set() in the Manila
tests should be replaced with self.mock_object() and any related
dead code should be removed.
Resolves-bug: #1415602
Change-Id: Ie5f203c0b2cb57ad00d9ec8db0529075b6fef261
Add possibility to run Generic driver without handling of share servers. It
allows us to create shares, without share-networks defined, on one specific
Nova VM.
Added three (3) new config options that are used only with new mode:
- 'service_instance_name_or_id' expects string with name or id of Nova VM.
- 'service_net_name_or_ip' expects name of network that Nova VM is switched to
or IP itself. Used for handle operation of share.
- 'tenant_net_name_or_ip' expects name of network that Nova VM is switched to
or IP itself. Used for exporting share to end users.
All three new config options are required if new mode is enabled.
They will be skipped if driver mode with handling of share servers is enabled.
Implements bp single-svm-mode-for-generic-driver
Change-Id: I48864b002e4174728136d093b1a17dad2edec605
Manila uses v1 Cinder API for it's Generic driver.
Cinder v1 API is deprecated and is going to be removed,
see: https://blueprints.launchpad.net/cinder/+spec/deprecate-v1-api
So, update our Generic driver to use v2 Cinder API.
Implements blueprint v2-cinder-api-for-generic-driver
Change-Id: I3cbd713a9a4c6eccee50ba4af4bdf2794db021d7
Generic driver will use nova instances to reach multitenancy,
so this patch adds a module for interacting with nova.
Partially implements: bp generic-driver
Change-Id: Ic51971f0fe72bcbbe364e8f6aa4c59a8ec267c83