Commit Graph

50 Commits

Author SHA1 Message Date
Takashi Kajinami a7be9c3824 Nova: Remove unused server operations
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
2022-07-18 11:17:48 +00:00
Takashi Kajinami 39a031e65c Nova: Remove unused image apis
Currently images are managed by Glance, instead of Nova, and these
implementations are no longer used.

Change-Id: Iabd4591b6782b135faa137a1e14a1fb760127ee6
2022-07-18 11:17:37 +00:00
Goutham Pacha Ravi 04e06968fd Handle service client authorization errors
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>
2021-06-24 15:45:04 +00:00
Tom Barron 5af3b8e68b Remove deprecated config and auth
Remove manila configuration options
and auth classes that were deprecated
before the Ussuri release.

Change-Id: I148225926cd249a0dd8d1f8c02b22ed06487f405
2021-04-26 11:53:58 -04:00
haixin 6fb2e8510e remove usage of six library
remove usage of six library from the following directory:
1:common
2:data
3:db
4:message
5:network
6:scheduler

Change-Id: I9db0abf2b0847157074ca6ba84b5451bfe3f20d0
Signed-off-by: Goutham Pacha Ravi <gouthampravi@gmail.com>
2021-01-27 13:46:31 -08:00
ericxiett a7aa847097 Fix error that failed to get image for booting server
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
2019-12-13 01:31:22 +00:00
Goutham Pacha Ravi 198bea78ac Deprecate old keystone session config opts
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
2018-12-20 17:29:40 -08:00
lijunbo 7969d94078 Remove deprecated DEFAULT options
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
2018-04-23 21:01:10 +08:00
zhangdaolong 932847b644 Fix inappropriate parameters
It's easy to misunderstand for using attachment_id.

Change-Id: I3bd3b96d721fe82a37b41d98d4d3d0ab59178f06
2017-07-13 10:04:04 +08:00
Valeriy Ponomaryov 5d5666b10e [Generic driver] Fix incompatibility with novaclient
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
2017-06-06 13:05:10 +03:00
Valeriy Ponomaryov 11b38f3188 Add support of endpoint_type and region_name to clients manila uses
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
2016-11-02 18:14:04 +02:00
Tom Barron 72ab1442ad Remove unused logging import and LOG global
This patch removes unused global LOG variable
and logging imports from various manila modules,
and adds a script to be run as part of pep8 that
will ensure that these do not creep back into
the codebase.

Change-Id: I162c4b2478df45aaf6ea8009b102d6de1a4e309e
2016-04-05 07:06:08 -04:00
Marc Koderer 8f7df3fc53 Capitalize global var for clients
TrivialFix

Change-Id: I84d67546e541b29f127057e6c7da990db71f6955
2016-03-23 10:00:55 +01:00
Marc Koderer 7fc492ea79 Fix keystone v3 issues for all clients
This fix basically ports nova fix https://review.openstack.org/#/c/136931/
plus additional bug fixing to Manila. It creates a common class to get
used for all clients (neutron, nova, cinder).

Idea is to create an auth session and pass this to the client object
instead of let the client do that. The auth session will be created by
a config group which means the configuration for the clients needed to be
heavily reworked. Patch is also backward compatible with old options but
flag them as deprecated.

DocImpact

Change-Id: Ic211a11308a3295409467efd88bff413482ee58d
Closes-bug: #1555093
2016-03-18 14:42:33 +01:00
Jenkins 301584f3ab Merge "service instance: also recognize instance name" 2016-03-16 13:49:16 +00:00
Thomas Bechtold bca18c6f10 service instance: also recognize instance name
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
2016-03-16 12:48:17 +01:00
Ben Swartzlander ce6924ae78 Collapse common os_region_name option
The os_region_name option appeared 2 places
in manila. This change moves them to the core
options list.

Change-Id: I5477c4e8b7c1523615fa50782d1c41e42e5f4fe6
Closes-bug: 1454590
2016-03-11 13:05:14 -05:00
Vincent Untz ef4393aefc Use existing "insecure" options when creating nova/cinder clients
Change-Id: I49e73e208516df19ba57ea9aa1f5f7b11b07bcb5
Closes-Bug: #1544929
2016-02-12 12:20:42 +01:00
Thomas Bechtold 296ca1ba7c Remove unused server_get() method
server_get() from the compute/nova.py file is not used anymore.
So remove it.

Change-Id: I36308563720c006980c10200d886eb73bd78d666
2016-01-21 09:16:14 +01:00
vponomaryov 95940a4085 Fix handling of Novaclient exceptions
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
2016-01-04 12:46:03 +02:00
Shuquan Huang 8247f350af remove default=None for config options
In the cfg module default=None is set as the default value.

Change-Id: I9303e2ae4b8f301757744efc09136868db29472a
Closes-bug: #1323975
2015-11-08 20:12:25 +08:00
Valeriy Ponomaryov e2ce257784 Fix usage of novaclient
We should use 'client interface' for initialization of novaclient
instead of direct import of some specific client.

Change-Id: I3172051e4dbba4eb17382cb1393b67829d8c0191
Closes-Bug: #1493576
2015-09-09 13:18:36 +03:00
Valeriy Ponomaryov f88c2aaeea Fix keypair creation
Use novaclient for creation of keypair instead of openstack client in
devstack plugin, because the latter is not compatible with
nova microversion 2.1

Also, specify explicitly Nova API version in manila wrapper over
novaclient that is used by Generic and Windows drivers.

Also, revert back amount of tempest threads for Ci jobs to avoid job
timeout failures.

Also, fix raise of SnapshotBuildErrorException in Tempest plugin.
Tempest tries to raise exception SnapshotBuildErrorException from wrong
place. It should use "share_exceptions" instead of "exceptions".

Change-Id: Ie9ea9f6d25a13f8cd8f0ccbc73f6fa75cca35e0b
Closes-Bug: #1493008
Closes-Bug: #1493072
2015-09-07 14:52:11 -04:00
Lucian Petrut d9c0bda0b7 Add Windows SMB share driver
This patch proposes a new share driver, handling Windows service
instances and exporting SMB shares.

WinRM is used for managing the service instances, allowing
password or certificate based authentication.

A new service instance manager is introduced, handling Windows
instances. One requirement is that Cloudbase-Init is present on the
instance.

If AD credentials are provided via security services, the instance
is joined to an AD domain. This can be leveraged in order to set
user based permissions.

A CI testing this driver will be up by L-3. Meanwhile, a link to
Tempest results can be found on the blueprint page whiteboard.

Change-Id: Ice5ee63ee4dc2cfcb41567214c165c2705421920
Implements: blueprint windows-smb-support
2015-08-31 12:24:19 +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
Li, Chen b566f5ef61 Switch to v2 version of novaclient
Currently v1_1 version of novaclient is deprecated, so it's required
to switch for v2 version of novaclient.

Change-Id: I824e8659febfeb86721b610a03a8c3027042cb3d
2015-03-31 17:05:07 +08:00
Ponomaryov Valeriy e7dbe837f9 Add nova network plugin
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
2015-03-07 18:46:31 +00:00
Ponomaryov Valeriy 79949476ed Add Nova-network support to service_instance module
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
2015-02-25 14:07:32 +02:00
Valeriy Ponomaryov 63a0504c21 Use oslo_log lib
Module 'log' from oslo-incubator was removed after release of oslo_log library.
So, start using oslo_log, but keep oslo-incubator code yet other common modules
within Manila codebase use it.

Implements bp use-oslo-log-lib

Change-Id: I88224f7c2bd99adb78140dfc3fa73cea437f29cd
2015-02-08 10:42:40 +00:00
Valeriy Ponomaryov 53b40423f4 Implement additional driver mode for Generic driver
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
2015-02-02 13:57:19 +02:00
Jenkins da23dcf2f4 Merge "fix typo in nova.py helpline" 2015-01-31 14:27:28 +00:00
Thomas Bechtold 071d0b59c1 Switch to using oslo_* instead of oslo.*
The oslo team is recommending everyone to switch to the
non-namespaced versions of libraries. Updating the hacking
rule to include a check to prevent oslo.* import from
creeping back in.
oslo.messaging is the only exception because this package doesn't
currently support non-namespaced imports.

Change-Id: I3987e651bc880c8ffa7c0105df0298679dcd3a43
2015-01-27 09:19:50 +01:00
Danny Al-Gaaf ba12cc1bb7 fix typo in nova.py helpline
Change certicates to certificates in help line for
nova_ca_certificates_file.

Change-Id: I4556976a28d8146c8ddc9fe358cabed086000155
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2015-01-21 22:57:08 +01:00
Valeriy Ponomaryov bfed689614 Use Cinder v2 API within Generic driver
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
2015-01-05 23:05:01 +02:00
Andreas Jaeger 630c08fbd4 Use oslo.utils - remove importutils usage
Use importutils from olso.utils instead of the deprecated version
from oslo-incubator.

These four files were missed in the previous change "Use oslo.utils"
with id I4f949de57e333832dcc7c1e256ce82e2db0144cb.

Change-Id: I198ea24a0512c60f11caad7cf8ae8c504442026d
2014-10-24 18:20:54 +00:00
Andreas Jaeger 24cb089fee Fix some LOG.debug invocations
LOG.debug("Hello %s" % xyz) should be LOG.debug("Hello %s", xyz).
This allows the logging package to skip creating the
formatted log message if the message is not going to be emitted because
of the current log level.

Change-Id: Ie0c91cd940017fd80d1d84b0e56780a1da980858
2014-09-16 08:04:09 +02:00
Jenkins 948aa13e7b Merge "Improve help strings" 2014-08-29 06:07:27 +00:00
Andreas Jaeger ab61d9bad4 Improve help strings
Make help strings consistent:
* Add missing spaces between words
* Capitalize first word of help
* Add "." at end of string
* Improve wording and capitalization

This follows the oslo.config style guide:
http://docs.openstack.org/developer/oslo.config/styleguide.html

Change-Id: I8243909249423b6b58ccda0d800856f46b0953c5
2014-08-28 06:56:59 +02:00
Andreas Jaeger 2641eb9b57 Flake8: Fix and enable H405
Fix H405:
H405  multi line docstring summary not separated with an empty line

With this patch, flake8 passes all checks (incl. hacking checks)
except the on-purpose disabled check H904.
Closes-Bug: #1333290

Change-Id: If41259aefc4d6d588da5036f1f25df17b88db04f
2014-08-27 13:39:22 +02:00
Andreas Jaeger ab96ccb1ef Flake8: Fix H302
Fix H302 and enable the test:
H302  import only modules.'from X import Y' does not import a module

Fix also in the touched files the following:
E128 continuation line under-indented for visual indent

Change-Id: I3116c030a5dc0b5be2b4413beaa460e483215774
Partial-Bug: #1333290
2014-08-26 12:50:59 +02:00
Andreas Jaeger baad6f7894 Further pep8 fixes
Fix the following issues in some files:
F401 'XXX' imported but unused
E123 closing bracket does not match indentation of opening bracket's
line
E126 continuation line over-indented for hanging indent
E128 continuation line under-indented for visual indent
E129 visually indented line with same indent as next logical line
H904  Wrap long lines in parentheses instead of a backslash

Partial-Bug: #1333290
Change-Id: Ic9b3a1e47fd24d2835f35f2ef71c4519908ff049
2014-08-15 15:41:56 +02:00
Jenkins 9f8550506d Merge "Made safe get of security_groups with nova's response" 2014-05-21 07:07:32 +00:00
Yulia Portnova 2c7595a386 Share servers implementation
Change-Id: I90664235237e25190191a4499e513a9fe589b855
2014-05-20 13:10:43 +03:00
vponomaryov 8aabc76778 Made safe get of security_groups with nova's response
Change-Id: Ia4e6ea1a9b9a0c71760487f3717125a274d11b9f
Closes-Bug: #1320938
2014-05-19 19:30:51 +03:00
Valeriy Ponomaryov 45dc9bddc5 Added handling of secgroup for service_instance module
Change-Id: If3cb5f7436142e4eb8829690117d15c3029ed9d2
Closes-Bug: #1314591
2014-05-14 17:30:40 +03:00
Christian Berendt 79cd06323c debug level logs should not be translated
According to the OpenStack translation policy available at
https://wiki.openstack.org/wiki/LoggingStandards debug messages
should not be translated. Like mentioned in several changes in
Nova by garyk this is to help prioritize log translation.

Change-Id: Idd917acd97481d6b644e307adb002354b37f34a1
2014-05-13 14:13:53 +02:00
Valeriy Ponomaryov 2db02e22b7 Fixed possibility to have more than 25 shares with generic driver
Change-Id: Ibca0c33518d61a4b4eb37c243ef103e70859bc0f
Closes-Bug: #1315266
2014-05-02 21:25:42 +03:00
Andrei V. Ostapenko 9a7e113b3a Adds nova api needed for generic driver implementation
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
2014-02-10 10:10:32 +02:00
Mark McLoughlin f272ce5b11 Remove unused manila.compute.aggregate_states
This appears to be unused.

Change-Id: Id8bc376d9ea4f3cebbfde527a2870d529eb74cd8
2013-10-17 07:15:12 +01:00
Yulia Portnova dc4ce932ed Renamed cinder to manila.
Fixed setup.py, fixed bin scripts.
2013-09-02 09:59:07 +03:00