Now iscsi target driver assumes that volume name always start with
"volume-". In fact the name can be configured[1]. This change gets
the volume id from volume object directly.
Closes-Bug: #1597317
[1]: 9da9ebb345/cinder/objects/volume.py (L142)
Change-Id: Iaa366fbc4ddc0265255e5a4d2bb9d166a665856c
In updating manage_existing to use volume object,
some issues were introduced. Fix them quickly.
Co-Authored-By: Chuck Fouts <fchuck@netapp.com>
Change-Id: Id0a60c5eaf5e6a133d0f911ab00fc66540ade447
Closes-Bug: #1594421
Snapshot object has no attribute about size,but some unit tests
still use snapshot['size'].We should use snapshot['volume_size']
to modify it correctly.This patch will fix it.
Change-Id: Ibe237334482fc2decdd23181d1843cd19df95bfa
Closes-Bug: #1599522
When executing purge on a database with snapshots created from volumes
with glance metadata, it fails due to a foreign key exception.
This patch adds the table at the end of the purge and forces the use of
foreign key checks on the tests
Change-Id: I67436a8319155bb47dfa67544ccae25f337ed246
Closes-Bug: #1489523
Since the core code has been changed to use
versionedObject, Huawei drivers now changes to
use versionedObject too.
Implements: blueprint huawei-use-versionedobject
Change-Id: I4d0e7ac804a9d42754e7f7ce70cdd8af132e173a
When hosts are filtered for a request, and no host passes all the
filters, operators can only see the last filter run; they have no
visibility into which filter removed which host. This attempts to
improve this situation by tracking the hosts remaining after each
filter is run and the number of hosts removed. If no host is left,
that information along with volume ID of the request would be logged.
Since that can be a lot of information, it will call LOG.info with
just the counts for all but the final filter, which will contain
the last deleted host names, LOG.debug will output the full record
of each filter and the hosts remaining after each step.
This will better enable operators to determine why a particular host
was not selected.
Change-Id: I3baf75a4a4430c55b30dde1cae86fa5e195ec6d3
Currently volume type creation with extra_specs set to null or
a string fails with AttributeError. This is because the current
validation logic assumes that extra_specs is a dictionary. This
patch fixes it by checking whether extra_specs is a dictionary
and raises InvalidInput if it is not.
Change-Id: Icc3580b5b1d784fa9c7fe07ac1c539af1b292075
Closes-bug: #1599106
Instead of using assertFalse(A * B) / assertTrue(A * B),
developers should use assertEqual/NotEqual/Less/LessEqual
/Greater/GreaterEqual/In/NotIn/IsNone/IsNotNone
The * operator: '==', '!=', '<', '<=', '>', '>='
Change-Id: I11b60a93c089f688c6b243da01d20c205c4f2df9
In Python 3 __ne__ by default delegates to __eq__ and inverts the
result, but in Python 2 they urge you to define __ne__ when you
define __eq__ for it to work properly [1].There are no implied
relationships among the comparison operators. The truth of x==y
does not imply that x!=y is false. Accordingly, when defining
__eq__(), one should also define __ne__() so that the operators
will behave as expected.
[1]https://docs.python.org/2/reference/datamodel.html#object.__ne__
Change-Id: I40878c38fd27933d73225ba49bd69b425f13dc6a
In the dev-ref, the hint key for volume create API
should be 'OS-SCH-HNT:scheduler_hints' but not 'scheduler_hints'.
Furthermore, it should be parallel with the key 'volume'.
To be more clear fix the example as well.
Change-Id: I999aebb0e53ebac5dc121ef1ccdc98f9d5ac816a
The volume update API also allow users to update the volume'metadata.
But cinder doesn't check the length limit. It'will raise 500 error
if the metadata is longer than 255. We should check it and raise
413 at the api layer to keep the same with the volume metadata
update API.
Change-Id: I3928ffff9aab6a8071d0641fa6b40b10b1f6bc10
Closes-bug: #1598007
When creating a volume from a snapshot or cloning an existing
volume the driver first creates a new volume of the original
size, then extends the volume if needed to meet the requested
size. The extend call in these operations were passing the
wrong arguments into the extend_volume call, resulting in an
exception being thrown.
Change-Id: I503543fc45a0607d295a2ebe3602436857fc8ff8
Closes-bug: #1598148