Network port host can be totally different than manila host,
So it's weird to force binding host to only manila host.
`service_network_host` allow we specify host for network ports
when `dhss` is True.
Change-Id: I3d9a3bbc81f18d60a0710d9336ad6f97176875be
When creating port bindings for ports inside Neutron, Manila
just uses the hostname using "socket.gethostname()" rather
than the one provided via CONF.host
The default behaviour of CONF.host is "socket.gethostname()"
anyways, so it should work just fine.
Closes-Bug: #2037580
Change-Id: I4181a6f1527c80bf356d6363300b2d420921e7fa
... instead of executing the cat command as an external process.
One benefit of using an external process is that we could avoid
eventlet threads being blocked, but ssh public keys are usually tiny
and is not expected to cause huge blocking.
Change-Id: I5b03e26df36d6cc7564625b16d613b001b6dee0b
Currently images are managed by Glance, instead of Nova, and these
implementations are no longer used.
Change-Id: Iabd4591b6782b135faa137a1e14a1fb760127ee6
Python2 is no longer supported, so in this patch
set we remove the usage of the six (py2 and py3
compatibility library) in favor of py3 syntax.
Change-Id: I3ddfad568a1b578bee23a6d1a96de9551e336bb4
This uses the method _get_service_instance_name to generate the name
of the share service instance, instead of using directly the share
service id.
Note that it changes the default value of the
service_instance_name_template option to match the current default and
keep backwards compatibility.
Closes-Bug: #1945463
Change-Id: I3ee10f53315a37b47bd66eba082502b4209f4d95
Signed-off-by: David Caro <me@dcaro.es>
When the image count is over 25, there might not get
manila-service-image, because current manila shares
creation is using novaclient to get image info, but
novaclient can only get 25 images due to pagination
of glance server, So this change is to switch to use
glanceclient instead of novaclient to get image info,
because glanceclient can iter all image info, while
novaclient is rarely maintained with stuff of image
API.
Change-Id: Id1715d0b9cb3a4aeedeb23d9b1d9924a78d18dc6
Closes-Bug: #1741425
Neutron can filter ports by subnet-id by itself, so:
- Don't send all ports in Neutron on every share-server removal
- Don't send fixed-ips fields (which are nearly half of total data)
Closes-Bug: #1879754
Change-Id: If42c9a0a662a62bbe2a02b6baee6ae13eedd8c97
Signed-off-by: George Melikov <mail@gmelikov.ru>
The code for clearing routes currently lives inside the
service_instance module but it belongs better inside the linux
interface ones.
This patch refactors it into there, which can allow for a true
noop driver as all network operations would happen inside that
section.
Change-Id: I9fa29e9e5ed7dd2c620b56efab559f4cec25aced
This patch refactors the code which clears routes into another
function which already gets all of the subnets to avoid hitting
the Neutron API twice, and allowing us to eventually refactor
all of this code into the linux interface management API.
Change-Id: I6e1debce1ac379d15190db82299bdd92c9ff7734
There's a few functions which are used inside service_instance
which do networking that can live inside the linux interface
driver code.
This patch refactors them into there as this helps allow for
the noop driver.
Change-Id: Ib79ae3f08843414a552c89cd9a254b5e562123b8
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
When set 'reclaim_instance_interval' larger than 0, share server
was deleted cause that the server exists until
reclaim_instance_interval. This patch checks status 'soft_deleted'
of instance to avoid the timeout.
Change-Id: Ib481c1699b19ee8c37473081f1aec780ed384e9d
Closes-Bug: #1844596
- Add ignores to pylint false positives in the
test modules.
- Remove unnecessary fake data
- Fix wrong mock methods used in tests
Change-Id: I64ffff15cc546c67e7e545b1da7ec0efa002bdc5
"storage_availability_zone" in the [DEFAULT] section of
manila's configuration file has allowed deployers to configure
and manage both service (scheduler, share manager) and storage
system availability. However, quite often manila's services
(api, scheduler, share and data managers) are run on a dedicated
control plane that is a different failure domain from that of
the storage that manila manages.
Also, when using share replication, deployers would need to
run multiple manila share manager services with different
configuration files, each with their own
"storage_availability_zone".
To allow flexibility of separating service and storage
availability zones, we introduce a new configuration option
"backend_availability_zone" within the share driver/backend
section. When this option is used, it will override the value
of the "storage_availability_zone" from the [DEFAULT] section.
Change-Id: Ice99a880dd7be7af94dea86b31a6db88be3d7d9b
Implements: bp per-backend-availability-zones
Added new config option limit_ssh_access. If set to true the
neutron security groups are set up to block port 22 from other
subnets than service network in service instance.
Change-Id: I3c247ac2c55e5c74dbb0c8e31144bb865fd48710
Closes-bug: #1714288
Use "driver_handles_share_servers=True" backend driver.
When create service neutron port to connect with service instances,
we should set the port security group is disable, to prevent be added
the default security group in neutron. Because some cases the default
security group would lead to the port can not connect with the service
instances.
Change-Id: Ib13e4f80c5a54b2b863b511ebb6e8f82700a3639
Closes-Bug:#1720283
When the image count is over 25, there might not get
manila-service-image, because current manila shares
creation is using novaclient to get image info, but
novaclient can only get 25 images due to pagination
of glance server, So this change is to switch to use
glanceclient instead of novaclient to get image info,
because glanceclient can iter all image info, while
novaclient is rarely maintained with stuff of image
API.
Change-Id: Id905d47600bda9923cebae617749c8286552ec94
Closes-Bug: #1741425
when the image is not active status, it should be raise
error, because there is no need to take an error status
image to create share server.
Change-Id: Ib31b9a627a9bbd413e46bfc09775e0c6d30ac084
Closes-Bug: #1740010
Please read spec for design detail [1].
Support IPv6 in IP drivers, networks and share
type extra specs.
Co-Authored-By: TommyLikeHu(tommylikehu@gmail.com)
Co-Authored-By: Ben Swartzlander <ben@swartzlander.org>
[1] f7202a6cfe32a057f752a4e393f848f8a0211c36
DocImpact
Partial-Implements: blueprint support-ipv6-access
Change-Id: I96d3389262e9829b8b4344870cdf5c76abd22828
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
Nova network was deprecated in Newton and is no longer supported for
regular deployments in Ocata [1].
As a first step towards removal and cleanup of nova network plugin
from manila, remove support for it from the service instance module.
[1] http://docs.openstack.org/releasenotes/nova/unreleased.html
Partially-implements: bp remove-nova-net-plugin
Change-Id: I846b760fa7c01f7f86768399a2bfad9ced7e57cd
Manila unit tests contain several occurences of
assertEqual(True, ...) instead of assertTrue(...).
Fix these occurences and add hacking check so new
occurences don't creep into the codebase.
Closes-Bug: #1584948
Change-Id: Ib586590b9efcb5253e8c09ee735a8ffb62b44d74
Manila share manager has possibility to save share servers
details even if it failed to be created on some step.
To use it, share driver should attach 'detail_data' attr
to exception with dict of share server details.
But, if such data not provided or has unexpected type, then
manager writes "warnings" to LOG. So, make it have "debug" level
of logging because here is nothing to do for admin/operator.
Also, fix Generic driver's case when it does not provide information
when has it - on negative result of
share server network availability check.
Change-Id: If8926ad383669fd5ccbe69cf13b574bc044f19be
Closes-Bug: #1547076
Implemented admin network support in generic driver
by creating extra ports in service instance.
In order to implement admin export location, Admin must
specify admin_network_id and admin_subnet_id
in driver configuration in manila.conf to create ports
between host and network of choice.
Possible scenarios are covered by this change:
*1: service network.
*2: service network and tenant network.
*3: service network and admin network.
*4: tenant network and admin network.
Admin network and tenant network configurations have
higher priority than service network. If both are
present, service network is not used.
Only admin network export locations are
is_admin_only = True.
Included additional admin_only export location
when creating shares and creating shares from
snapshots.
Removed deprecated 'service_ip' property of
server backend details.
Implements: blueprint admin-network-generic-driver
Change-Id: I8d8694ac3d83aa12a756112dfefebd7e17e32383
As observed in several failed gate tests, there is a concurrency
issue between nova+neutron and Manila in generic driver.
This patch addresses this.
Change-Id: Ie5f01c937f30d994dc3c2df3f647cc90f29245ff
Closes-bug: #1548350
There are cases where the server details don't have an instance_id
set but we need to check for that so we can avoid a KeyError. We
also log this case as a warning like the InstanceNotFound in the same
method. Ideally we'd log the share server ID for context but we don't
have that available in this method which is given ShareServerBackendDetails
key/values.
Change-Id: I8cabf7f3a5a3480a1f55a19fbdcebfc272906332
Closes-Bug: #1542365
Currently, after getting the list of ports from neutron,
we filter based on the device_id. In HA, two nodes will
share the same device_id. Hence, ports on different HA
backends are reported together causing a
ServiceInstanceException, not allowing for port creation
on the required backend.
This patch will use both device_id and binding:host_id
properties to filter neutron port lists to check for
valid port clashes if any.
Closes-Bug: #1519326
Change-Id: I81a16c360b1e8fffccddef5f358136e5fbde81e4
Fix incorrect order assertEqual(observed, expected) as below.
assertEqual(observed, expected) => assertEqual(expected, observed)
Target of this patch:
manila/tests/share/*
Note:
I also fix following asserts around above fixed parts.
assertEqual(xx, True), assertEqual(True, xx) => assertTrue(xx)
As for assertFalse,
I do not convert assertEqual(xx, False) to assertFalse(xx)
because assertFalse(None) does not raise exception.
Change-Id: I56688105ab3b77e4f71bde472763a9c02c43664b
Partial-Bug: #1259292
Added minimal Share Migration support to generic driver,
so the Generic Migration procedure can work.
The approach to support is to add a field to Share Server
backend_details named service_ip with the port IP address that
allows the controller to access the Share Servers (same IP address
which they SSH through), this IP is used to return the access rule
required for the generic migration procedure.
For "driver_handles_share_servers=False" mode, configuration falls
back to common implementation in Core code and its parameters.
Optimized migration for Generic Driver will be included
as a separate patch.
Change-Id: Ie7d19a44c9ab05c5a6a79c30478be23b2e8a3ba2
Implements: blueprint share-migration
Replace assertEqual(None, *) with assertIsNone in tests to have
more clear messages in case of failure.
Closes-Bug: #1280522
Change-Id: I2d5285add72678b5a61b4f66879c4d066afc34c7
Update ServiceInstanceManager to respect AZ when
creating Nova VM's.
Partially-Implements: blueprint availability-zones
Change-Id: I5c734a6b82c4eec189951ba35e076e36699e1c10
When the Manila share service starts, it instantiates
the Neutron network helper, which makes a call to the
Neutron service. If the service is started and the
Neutron service is unaccessible, the share service will
fail to even start.
This patch lazy loads those parameters so that they are
only loaded when needed (and presumably when the Neutron
service is up).
Change-Id: I1857c0cb6fc41afd0d01916addc1fd216070ffd7
Closes-Bug: #1481331
This patch adds a method in the Service Instance manager class,
responsible of rebooting service instances.
This will be used by the soon to be introduced Windows Driver.
Change-Id: Id82803339f5ddfef64eaf30a72d2c1632c4c6a9b
Partially-implements: blueprint windows-smb-support
This patch moves some of the logic from the Service Instance class
to separate methods, which can easily be overridden or re-used.
This will let us introduce Windows Service Instance support,
inheriting the Service Instance class.
Change-Id: I253f5ad9f12fc63ad189059aa667ab4e7d10484a
Partially-implements: blueprint windows-smb-support
List creation '[x for i in 1,2,3,....]' causes SyntaxError
in Python 3.
Add range() function for Python 3 compatibility.
Partially-Implements: bp py3-compatibility
Change-Id: Id7cc9b9c2e45f17e76bb5e698d7628a455452400
As of liberty.2, the Manila unit tests are taking ~60 seconds to run
on my system. A dozen or so of the tests consistently take an integral
number of seconds to run (i.e. 1, 2, 3 or 4 seconds), indicating the
presence of a time.sleep() call in the code that hasn't been mocked.
By mocking time.sleep() and time.time() in just a few files, the time
needed to run the unit tests falls by a third to ~40 seconds (!).
Change-Id: I66a6d864823b10a4193eadf65a1c5d3028f2afa7
Closes-bug: 1478644