VMware: Usng RetrvProprtisEx & does multi ESX scan
The existing code uses deprecated API RetrieveProperties for querying through
property collector. The public doc asks to use RetrievePropertiesEx instead.
RetrievePropertiesEx works by retrieving results in serveral batches rather than
retrieval in a single API call. This works well in environments containing
large number of VMs or ESX hosts.
There are three steps involved 1. Get first batch 2. Continue retrieving using
a token 3. Cancel retrieval when not needed
Batch size is user configurable, default is 100 results per batch.
The review also fixes a careless programming error leading to scanning only
1 ESX host under the vCenter server for datastores.
Eric Harney [Wed, 25 Sep 2013 19:43:32 +0000 (15:43 -0400)]
Allow upgrade from Grizzly with ThinLVMVolumeDriver
In Grizzly, LVM thin provisioning was used by setting
volume_driver=...ThinLVMVolumeDriver. In Havana this
functionality has moved under the standard LVM driver
with the option "lvm_type=thin" used to enable it.
We should account for the old volume_driver class path
so that the volume service behaves as expected for users
upgrading from Grizzly ThinLVM configurations.
Mike Perez [Wed, 25 Sep 2013 03:55:04 +0000 (20:55 -0700)]
Pass correct args to vol_rpc create_volume calls
In the chance and simple scheduler, create volume was originally using
snapshot_id and image_id for request_spec and filter_properties. This
corrects that by passing the correct arguments and keyword arguments to
create_volume.
Eric Harney [Fri, 13 Sep 2013 20:56:44 +0000 (16:56 -0400)]
LVM volume_clear: error on unexpected inputs
Currently if a user configures
volume_clear='non_existent_volume_clearer' in cinder.conf,
the LVM driver will silently delete a volume and not wipe it.
Instead, the delete operation should fail, leaving the volume
in the 'error_deleting' state.
Also fail if the volume reference does not contain either a
'size' or 'volume_size' field.
Add a specific filter for /usr/local/bin/hus-cmd, rather than adding
/usr/local/bin to the list of exec_path in rootwrap.conf. This allows to
sync rootwrap directly from oslo-incubator without having to edit the
default value for exec_dirs.
Allow v2 Volume API to create volume with type name
v2 API only accepts volume type ID when creating volume, while v1
API allows both volume type name and ID (volume type name is unique
in Cinder). This patch enables v2 API to accept volume type name
as create() parameter. Aslo volume type validation code block
in v1 API create() is refactored to a slimmer version.
Change the chance and simple schedulers to pass the snapshot_id and
image_id parameters correctly volume_rpcapi, so that their values reach
cinder-volume.
Eric Harney [Tue, 3 Sep 2013 18:52:03 +0000 (14:52 -0400)]
Require assisted_volume_snapshots from novaclient
The "QEMU-assisted-snapshots for GlusterFS volumes" patch currently
does a try/except ImportError for the new assisted_volume_snapshots
extension in novaclient. That functionality is now in novaclient
2.15.0, so Cinder should consider this a hard requirement rather
than allowing it to be absent.
John Griffith [Fri, 20 Sep 2013 20:55:46 +0000 (20:55 +0000)]
Fix issues with failed lvremove
There are some race conditions that
can cause problems with lvremove commands. In
most cases these seem to recover nicely just
with a simple retry of the lvremove. Adding
a udev settle seems to elimate the rest of them.
This is a difficult issue to reproduce, and there's
a suspiscion that it relates to failed target
creeates.
The patch adds a catch on the lvremove failure,
followed by a udevadm settle and a retry of the
lvremove. With the setup that I've been able
to reproduce this issue these changes have eliminated
any force delete failures.
The other option that had been proposed was using dmsetup remove
but there are concerns that this may cause problems.
Eric Harney [Mon, 9 Sep 2013 22:47:00 +0000 (18:47 -0400)]
GlusterFS: Copy snap from correct source file
The GlusterFS driver's copy_volume_from_snapshot was previously
not parsing the snapshot information to determine which backing
file to copy from, instead copying from the active file at all
times. This would result in the wrong data being supplied when
a volume is cloned from a snapshot.
Add a test for the copy_volume_from_snapshot method.
Eric Harney [Sun, 8 Sep 2013 14:18:18 +0000 (10:18 -0400)]
GlusterFS: Use image_utils for qemu-img calls
Code added for GlusterFS snapshot support in Havana included
new code to parse qemu-img output. This removes this code
and uses image_utils qemu_img_info instead.
Add test to image_utils for parsing a different style of
qemu-img info output.
Improve GlusterFS driver test coverage with tests for cloning,
create from snapshot, and initialize_connection.
John Griffith [Fri, 20 Sep 2013 02:47:22 +0000 (20:47 -0600)]
Add a retry to create_iscsi_target for LVM
There's a bug in the tgt driver where under certain
conditions where a race condition is present that can
result in tgtadm attempting re-use a target ID.
Testing this it seems that a retry will address this nicely
and cause tgtd to grab a new target ID and things are ok.
This patch adds a simple check/retry mechanism around the
iscsi_target_create in the LVM driver to catch this issue and
deal with it.
There are a number of bugs that it appears can be attributed to
this, but this patch is associated with the most predominant
clear cut version.
Jim Branen [Fri, 20 Sep 2013 15:41:44 +0000 (08:41 -0700)]
Fix HP3PAR iSCSI path connection
The iSCSI paths are not correctly identified as ‘active’
when port information is requested from the hp3parclient
because the ‘active’ value is a Boolean not the string
‘true’.
Mike Perez [Tue, 17 Sep 2013 09:41:59 +0000 (02:41 -0700)]
Add volume metadata to v2
This exposes volume metadata in the Cinder v2 API. This already exists
in v1 and was originally suppose to exist back with Grizzly, but appears
to have slipped.
This updates the volume manager and the
backup manager to enforce that the driver
has been initialized.
The managers call the driver in many places
without ensuring that the driver has been
properly initialized. When the driver fails
inside of do_setup(), the managers shouldn't
call the driver's set_initialized() method.
The managers now dump out the exception, and
exit the init_host, leaving the driver in
an uninitialized state.
John Griffith [Thu, 19 Sep 2013 19:05:05 +0000 (13:05 -0600)]
Fix type change in bootable setting of volume view
Change Idd47a0a8069ee905b81c7aae562b82767ad91930 fixed a db
query issue, by removing the image_metadata querie in the get/show
methods.
The problem however is that we just passed the setting from the volume
object directly in the summary view builder. This results in changing
the type of the value from a string "true/false" to a bool True/False
which is no good.
This patch converts the object member back to a string like it used to
be so we don't break any compat or expectations in API behavior.
Bill Owen [Wed, 18 Sep 2013 21:30:07 +0000 (14:30 -0700)]
GPFS Driver missing clone depth limit for snapshots
GPFS driver is fixed to handle snapshot clones correctly. Previously,
these were allowed to grow without respecting limit defined in config
flag gpfs_max_clone_depth. This change adds the depth check operation
in create_snapshot.
To ensure that all clone files are cleaned up, the delete_snapshot
method now marks snapshots to be deleted with ts file extension
and attempts to delete the snapshot. If the snapshot cannot be
deleted because it has clone children, it will be deleted when the
child is deleted.
VolumeNotFoundForInstance class is used only in test_xiv_ds8k.py. I
think the exception class that is used only in test code should not be
defined in cinder/exception.py.
Luis A. Garcia [Fri, 6 Sep 2013 21:24:33 +0000 (21:24 +0000)]
Sync gettextutils from oslo
Some Messages, such as those created from Invalid exceptions, use a
Message within a Message, and we were only translating the base Message
but not the Message substitution within.
When doing a volume restore with Ceph backend to a non-rbd volume
that is greater in size that the backup volume, we write zeroes
the extraneous extents but we are not zeroing the final few bytes
in the case where the destination volume is non-rbd.
Also fixed up internationalisation on a number of log messages.
A mapping key of 'netloc' is always ignored. Thus information in
'netloc' is lost. But because it is included in 'error_msg', I remove
'netloc=netloc'.
A mapping key of 'volume_id' is ignored when we use the non keyword
argument. Thus information in 'volume_id' is lost. Similarly, in the
case of exception.SnapshotNotFound, information in 'snapshot_id' is
lost.
Previously the row for the temporary migration volume was deleted from
the database, which caused a foreign key violation for its admin
metadata. Regardless, the volume should have been soft deleted from the
database anyway, and this patch takes care of that.
Victor Rodionov [Tue, 17 Sep 2013 21:22:05 +0000 (01:22 +0400)]
Fix __init__ methods of brick initiator connectors
Wrong order of positional arguments in RemoteFsConnector __init__ call.
This only in RemoteFsConnector.__init__, but I decide also update
__init__ methods of other connectors to avoid errors in future.
This change modifies the behaviour of the secure delete for thick
LVM snapshots to wipe the underlying COW of the snapshot LV
instead of the snapshot LV itself.
This change is necessary because the snapshot LV does not contain
exactly the same number of writable blocks as the original LV. The
COW includes header information per COW block that identifies the
device as a COW device as well as the source and destination blocks
for the changed item. The amount of metadata contained in the COW is
variable based on I/O performed on the snapshot.
This does not change the behavior of secure deletes on thin LVs
or secure deletes on the thick LV snapshot origin.
Replace "params[params.index('-lun')]" with
"params[params.index('-lun') + 1]" to get lun ID correctly.
Replace the invalid controller ID "N" with "B".
Dict CLONED_LUN_INFO has no key provider_location, delete it.
Moreover, simplify the "if..., elif..." module with "getattr"
method in fake recv function.