summaryrefslogtreecommitdiffstats
path: root/nova/volume
Commit message (Collapse)AuthorAgeFilesLines
* Add ca cert file support to cinder client requestsCian O'Driscoll2013-05-161-4/+9
| | | | | | | | Allow for ca certificates file to be specified when doing cinder client requests. Needed when using custom ca authorities. Change-Id: Ib9aa15df2fc7d96cb8587c13769399e353c032c6 Fixes: bug #1179476
* Merge "Refactor nova.volume.cinder.API to reduce roundtrips with Cinder"Jenkins2013-05-151-69/+89
|\
| * Refactor nova.volume.cinder.API to reduce roundtrips with CinderOleg Bondarev2013-05-141-69/+89
| | | | | | | | | | | | | | | | | | | | Make cinder.API methods accept volume_id instead of the whole volume object. This will remove redundant roundtrip to get the volume before passing it to other methods as in fact they only need the id. Fixes bug 1172297 Change-Id: I5e7f944c1c29b2f211ece2ef86c0959c81e806df
* | Prevent rescuing a VM with a partially mounted volume.Joe Gordon2013-05-011-0/+6
|/ | | | | | | | | If a VM goes into rescue mode with a partially mounted volume, the volume won't re-appear after the VM is unrescued. Fix bug 1158942 Change-Id: I1e104236c41c59e67a0f0e9ef26143c57f6e0094
* Translate cinder NotFound exceptionChris Yeoh2013-04-171-1/+16
| | | | | | | | | | | | | | | | | When we attempt to get information about a snapshot which doesn't exist we get a cinder NotFound exception. However, this is not caught and causes a stacktrace in the logs. This occurs on every tempest run in the test EC2VolumesTest.test_create_volume_from_snapshot. The fix is to translate the exception to SnapshotNotFound which is handled correctly further up the call chain. Fixes bug 1169777 Part of blueprint no-stacktraces-in-logs Change-Id: If893b5083b93894e671c978bd23bd89d3d017531
* Clarify volume related exception messageJoe Gordon2013-04-101-1/+1
| | | | | | | | | Before the message was "status must be available," which could either mean nova couldn't fetch the status or the status was not set to 'available'. As this message means the latter, make it more explicit by putting available in quotes. Change-Id: I1b167073463c781569919926fa9b8960f4fecf59
* translate cinder BadRequest exceptionSean Dague2013-03-221-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | if we attempt to create a volume with values that are invalid (like a non numeric value for size) we properly get a BadRequest returned from cinder. However we inproperly pass that cinderclient exception all the way to the top of the request process, causing a stack trace to appear in the logs because this is an exception type Nova doesn't understand. This situation is triggered by Tempest on every run, and while the return is successful, the stack trace might spook people. Fix this by increasing the scope of the existing _reraise_translated_volume_exception() method. Longer term it would make sense to have a decorator that handles all possible exceptions we'd expect from cinder client and turn them into Nova exceptions. This reduces the number of stack traces in nova-api by 6 on a successful Tempest run. Fixes bug #1158505 Step towards blueprint no-stacktraces-in-logs Change-Id: Ifcfbd5eb11fe9f038f648ca5291499290b7126b1
* Use oslo-config-2013.1b4Mark McLoughlin2013-02-192-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | The cfg API is now available via the oslo-config library, so switch to it and remove the copied-and-pasted version. Add the 2013.1b4 tarball to tools/pip-requires - this will be changed to 'oslo-config>=2013.1' when oslo-config is published to pypi. This will happen in time for grizzly final. Add dependency_links to setup.py so that oslo-config can be installed from the tarball URL specified in pip-requires. Remove the 'deps = pep8==1.3.3' from tox.ini as it means all the other deps get installed with easy_install which can't install oslo-config from the URL. Make tools/hacking.py include oslo in IMPORT_EXCEPTIONS like it already does for paste. It turns out imp.find_module() doesn't correct handle namespace packages. Retain dummy cfg.py file until keystoneclient middleware has been updated (I18c450174277c8e2d15ed93879da6cd92074c27a). Change-Id: I4815aeb8a9341a31a250e920157f15ee15cfc5bc
* Add option to allow cross AZ attach configurableLiam Kelleher2013-02-141-1/+9
| | | | | | | | | | | | Make check_attach() optionally check if the volume and instance are in the same availability zone and if cross AZ attach is configured as not allowed report error. This does not change the current default behaviour. DocImpact: Adds a new Nova Config option Change-Id: Ib0e085888b1c6620869261d87cd964de302accb3
* Stop including full service catalog in each RPC msgJoe Gordon2013-01-281-1/+3
| | | | | | | | The service catalog is included in the context to get the cinder API endpoints. Instead of passing entire service catalog just for cinder endpoint, just include cinder endpoint in context.service_catalog Change-Id: Ic39173f0a2f330dbd78daa786b269f29ac4abf33
* Fix hacking N302 import only modulesJoe Gordon2013-01-241-2/+2
| | | | | | | | * Includes some general tools/hacking cleanup * Fix several N302 cases * Disable N302 until all cases are fixed Change-Id: Iddba07ff13e10dc41a6930749044bb8c0572d279
* Allow nova to use insecure cinderclient.Cory Stone2013-01-161-0/+4
| | | | | | | | Add an option cinder_api_insecure to pass on to cinderclient. Bug 1100459 Change-Id: Ifb31cc0df48d2345fa0a6ec440bdf9685254cbcd
* Adds a flag to allow configuring a regionRohit Karajgi2013-01-091-1/+13
| | | | | | | | | | If multiple regions contain an endpoint, extract the correct endpoint URL from the os_region_name parameter in nova.conf Fixes LP Bug #1087735 Change-Id: Id4e4f56f336cd2b092a173b3c8e695b173c76f2a
* Move api_class options to where they are usedMark McLoughlin2013-01-091-0/+9
| | | | | | | | The compute_api_class, network_api_class and volume_api_class options are only used in their respective modules, so move them there. blueprint: scope-config-opts Change-Id: Ib0497f46b44c4b3af7319550cc64c09d629ea362
* Support cinderclient http retries.Cory Stone2013-01-071-1/+5
| | | | | | | | HTTP retries were recently added to cinderclient. This adds the config option required to use it. The default (unchanged) behavior is 0 retries. Change-Id: Ia7ad831045e8df9ad9c22f0119ae3485d91ad949
* Extract image metadata from CinderNikola Dipanov2012-12-191-0/+4
| | | | | | | | | | | | | | | | This patch makes nova extract image metadata if it is present in the volume dict received from Cinder API. The volume image metadata is received from Cinder when the volume_image_metadata Cinder extension is loaded. This patch is part of the work done on blueprint improve-boot-from-volume as this metadata will be used when booting instances from volumes without the need to supply an image just for the metadata. Subsequent patches will make Nova consider this metadata when booting instances without and image id. Change-Id: I9e5925ea4147a41c41f9019933a47c5ccf756747
* Fixed deleting instance booted from invalid volUnmesh Gurjar2012-12-141-2/+19
| | | | | | | | | | 1. Translated the exception (NotFound) raised from Cinder client to Nova's native exception (VolumeNotFound). 2. Added unit test coverage. Fixes LP: #1087214. Change-Id: I3cee31a9fd068b65a4097f3f3054aebb69d9ba61
* Remove nova.config.CONFMark McLoughlin2012-11-202-4/+4
| | | | | | | | | | | | | | | Modules import nova.config for two reasons right now - firstly, to reference nova.config.CONF and, secondly, if they use one of the options defined in nova.config. Often modules import nova.openstack.common.cfg and nova.config which is a bit pointless since they could just use cfg.CONF if they just want to nova.config in order to reference CONF. Let's just use cfg.CONF everywhere and we can explicitly state where we actually require options defined in nova.config. Change-Id: Ie4184a74e3e78c99658becb18dce1c2087e450bb
* Remove nova.flagsMark McLoughlin2012-11-172-2/+0
| | | | | | | | Now that options have all moved from nova.flags to nova.config, we can safely remove the nova.flags imports and replace them with nova.config imports. Change-Id: Ic077a72dd6419bbf1e1babe71acfa43c4e8b55c8
* Remove volume.driver and volume.iscsiJoe Gordon2012-11-122-1189/+0
| | | | | | | | Remaining flags moved to nova.virt.libvirt.volume Part of bp delete-nova-volume Change-Id: I1b96c773f0b5df73b04215a4afb350a5583b0101
* Fix misuse of exists()Yun Mao2012-11-121-1/+1
| | | | | | | | Should be os.path.exists not os.exists Part of bug 1078062 Change-Id: I8126c496b3089ab65ce3b8c7fdcd84944b8e259f
* Switch from FLAGS to CONF in misc modulesMark McLoughlin2012-11-044-59/+63
| | | | | | | | | | | Use the global CONF variable instead of FLAGS. This is purely a cleanup since FLAGS is already just another reference to CONF. We leave the nova.flags imports until a later cleanup commit since removing them may cause unpredictable problems due to config options not being registered. Change-Id: Ib110ba8d1837780e90b0d3fe13f8e6b68ed15f65
* removes the nova-volume code from novaVishvananda Ishaya2012-10-2814-5980/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This removes the majority of the nova-volume code from the codebase. It updates relevent config options to default to cinder. It updates a number of existing tests that were depending on code that was removed. A few things still need to be removed: * volume/driver.py & volume/iscsi.py These files are used by the libvirt volume driver tests. These tests should be updated to mock the relevant calls. * scheduler/simple.py & scheduler/multi.py These files should no longer be necessary so they can be removed in a subsequent patch * exception.py cleanup Once the above files are removed there are a number of unused exceptions which can be removed * database calls and database tables The database calls have not been removed and the tables have not been dropped. This can be done in a separate migration * additional config options and nova.conf.sample There may be a few extra config options that can be removed and the conf sample can be regenerated Implements bp delete-nova-volume Change-Id: I0b540e54dbabd26901a7530035a38583bb521fda
* Merge "Migrate to fileutils and lockutils."Jenkins2012-10-261-1/+2
|\
| * Migrate to fileutils and lockutils.Michael Still2012-10-251-1/+2
| | | | | | | | | | | | | | Migrate nova to using openstack-common's file and lock utilities. Resolves bug 1063230. Change-Id: I1a4c87856bc08cd33b61d7098ed856baa4583654
* | SanISCSIDriver SSH execution fixes.Yuriy Taraday2012-10-231-3/+5
|/ | | | | | | | | | | | | | | | In ssh_execute methon in nova/utils there was a problem with cmd passed to it. From SanISCSIDriver and all other places it is called from cmd is a string. But in ssh_execute method cmd was processed as a list. This can make problems with SanISCSIdriver using. Also it may be useful to pass execute parameter to this SanISCSIDriver class to have the opportunity of overriding _execute method (as it is in VolumeDriver class, that is the root of this class hierarchy). That's why special checking was added. Fixes bug 1070489 Change-Id: I73f74f9d095a2c4316cab88148afe6a0bde44c5b
* remove deprecated connection_type flagSean Dague2012-10-011-2/+3
| | | | | | | | | | | | | | | Fixes bug #1025712 connection_type was deprecated in Folsom and should now be removed in Grizzly as early as possible to shake out any fallout. This removes all references to it, changes the config sample and tests appropriately. Remove old default fixtures for flavors that specify ephemeral disks if the connection_type flag was set to 'libvirt' Change-Id: I8af831600a1931ae92c6d06c5105bd1bd81debe3
* Replaced default hostname function from gethostname to getfqdnLuis Fernandez Alvarez2012-09-261-4/+4
| | | | | | | | | | | | | | Fixes bug 1055503 The standard behaviour of the 'gethostname' function in Python differs from Linux to Windows. A common Linux configuration returns the FQDN, while a Windows one returns only the host name. To resolve inconsistent node naming in deployments that mix windows and Linux, it is proposed to use 'getfqdn' as default function instead of 'gethostname'. This is function is more predictable in all cases. Change-Id: I3164d9a36df2b8484bbf9a57879c31fa0e342503
* Merge "Fixes remove_export for IetAdm"Jenkins2012-09-262-6/+4
|\
| * Fixes remove_export for IetAdmMotoKen2012-09-252-6/+4
| | | | | | | | | | | | | | | | | | * Corrects indentation. * Uses specific iqn as keyword argument. Fixes bug 1055401 Change-Id: I1267be37a7e7adcd2a18ffb719326c5f68296523
* | Merge "Fix NetAppCmodeISCSIDriver._get_lun_handle() method"Jenkins2012-09-251-1/+1
|\ \
| * | Fix NetAppCmodeISCSIDriver._get_lun_handle() methodBen Swartzlander2012-09-241-1/+1
| |/ | | | | | | | | | | bug 1055578 Change-Id: I06da6a9a59fa2320f1cae9698e5e63562e534916
* | Merge "Revert explicit usage of tgt-adm --conf option."Jenkins2012-09-251-3/+5
|\ \
| * | Revert explicit usage of tgt-adm --conf option.Eoghan Glynn2012-09-251-3/+5
| |/ | | | | | | | | | | | | | | | | | | | | | | Fixes bug 1056246. Reverts commit 0a09bf5faeb30b675fdb8f517c61166ef794bad3. This ensures that we fail-fast if the tgtd configuration does not include the directory for volume iscsi target configs, instead of only blowing up when tgtd is restarted. Change-Id: I3c9f0d97e411560e5c0fd058671f8c834e9bed1e
* | Merge "Fix config opts for Storwize/SVC volume driver."Jenkins2012-09-251-60/+44
|\ \ | |/ |/|
| * Fix config opts for Storwize/SVC volume driver.Avishay Traeger2012-09-211-60/+44
| | | | | | | | | | | | | | | | | | | | | | Removed the "vtype" option which did not work in the driver, and added the "easytier" option. Added another check to _check_flags and made sure -warning flag is passed properly. Added unit tests to check all option variations. Fixes bug 1049446. Change-Id: I135ed85ad1b9d60e6a8cc406aa49360e0f080039
* | Merge "Fixes to the SolarisISCSI Driver"Jenkins2012-09-211-6/+5
|\ \
| * | Fixes to the SolarisISCSI DriverYosef Berman2012-09-201-6/+5
| |/ | | | | | | | | | | | | | | | | | | Even when the san_is_local config option was set to false, the SolarisISCSIDriver's _execute method was accidentally set to util.execute by the VolumeDriver's __init__ method. Fix bug 1053041 Change-Id: Ifd8436874759d75633da3dbbfa01bd99f979ddea
* / Add lun number (0) to model_update in HpSanDriverJohn Griffith2012-09-201-2/+5
|/ | | | | | | | | | | The HpSanDriver was not setting the lun number in model_update and as a result default value of 1 was being used. Trouble is the Lun number used by LeftHand is 0, so the connect info would be wrong and fail when trying to attach the volume. Fixes bug #1053717 Change-Id: I2391db062dff35365030e33c3eb0569fdd397949
* Merge "Fix solidfire option declaration"Jenkins2012-09-201-3/+3
|\
| * Fix solidfire option declarationMark McLoughlin2012-09-201-3/+3
| | | | | | | | | | | | | | | | Fixes bug #1053427 The sf_allow_tenant_qos option is a boolean, not a string. Change-Id: I7d1e8c7e8f545710314395c91e269f08cc110c36
* | Replace builtin hash with MD5 to solve 32/64-bit issues.Ben Swartzlander2012-09-191-2/+2
| | | | | | | | | | | | | | | | | | | | It seems that Python's builtin hash returns different values on 32-bit and 64-bit architectures, so it's safer to use a well-defined hash like MD5. bug 1050359 Change-Id: Ibb49f7b9028085d2aedaf05b94e1e1dcdf5e4cb4
* | Correct IetAdm remove_iscsi_targetMotoKen2012-09-191-1/+1
| | | | | | | | | | | | | | | | | | | | Remove logical units should be done before delete the target while unexport iSCSI volume. Or ietd will show "No such file or directory" error. Fix bug 1043107 Change-Id: I06ac561898dbcee078c807ea5368c03e558b4fa9
* | Update quota when deleting volume that failed to be scheduledZhiteng Huang2012-09-182-10/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If one volume was failed to get scheduled, removing such volume should also clean up reservation. Also when create_volume is ready to send to scheduler, reservation should be committed no matter backend can successfully create that volume or not since deleting volume call will do a minus reservation even on volume with 'error' status. This change updates RPC API to version 2.2 Fix bug 1052052 Change-Id: Ia632a0e49318d534f0acbd3df5c9f6bb86eefa2a
* | add ability to clone imagesJosh Durgin2012-09-182-7/+99
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Given the backend location from Glance, drivers can determine whether they can clone or otherwise efficiently create a volume from the image without downloading all the data from Glance. For now implement cloning for the RBD driver. There's already a Glance backend that stores images as RBD snapshots, so they're ready to be cloned into volumes. Fall back to copying all the data if cloning is not possible. Implements: blueprint efficient-volumes-from-images Signed-off-by: Josh Durgin <josh.durgin@inktank.com> Conflicts: nova/volume/api.py nova/volume/driver.py This is based on a cherry-pick of cinder commit edc11101cbc06bdce95b10cfd00a4849f6c01b33 Change-Id: I71a8172bd22a5bbf64d4c68631630125fcc7fd34
* | Adds new volume API extensionsUnmesh Gurjar2012-09-184-21/+154
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds following extensions: 1. Create volume from image 2. Copy volume to image Added unit tests. Implements: blueprint create-volume-from-image Conflicts: cinder/api/openstack/volume/contrib/volume_actions.py cinder/tests/api/openstack/fakes.py cinder/tests/api/openstack/volume/contrib/test_volume_actions.py cinder/tests/policy.json nova/api/openstack/volume/volumes.py nova/flags.py nova/tests/api/openstack/volume/test_volumes.py nova/tests/test_volume.py nova/utils.py nova/volume/api.py nova/volume/manager.py This is based on a cherry-pick of cinder commit 2f5360753308eb8b10581fc3c026c1b66f42ebdc with bug fixes 8c30edff982042d2533a810709308b586267c0e9 and ffe5036fa0e63ccde2d19aa0f425ec43de338dd7 squashed in. Change-Id: I9c73bd3fa2fa2e0648c01ff3f4fc66f757d7bc3f
* | Merge "Fix volume deletion when device mapper is used"Jenkins2012-09-181-0/+4
|\ \
| * | Fix volume deletion when device mapper is usedRafi Khardalian2012-09-171-0/+4
| |/ | | | | | | | | | | | | | | | | Call dmsetup remove if there is a /dev/mapper/nova--volumes- element present. Resolves bug 979020 Change-Id: Iddaaed411a77dda4bd32f9a97687ff17744119eb
* / Add admin actions extensionClay Gerrard2012-09-141-2/+2
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The optional os-admin-actions extension adds new wsgi_actions to the volumes/action resource and a new snapshots/action endpoint. With this extension both controllers will support an os-reset_status action to force a database update of a volume or snapshot that is stuck in a failed/incorrect status. The os-reset_status action works similarly to the compute api's os-reset_state action for instances. The os-force_delete action behaves similarly to the "cinder-manage volume delete" command and allows operators/admins to retry the delete operation after it has gone into an error_deleting status with an admin api call. The os-admin-actions extension is enabled by default, but limited to the admin api by the default policy.json rules. Individual admin actions can be disabled with policy rules as well. Example of os-reset_status action on a volume: curl http://localhost:8776/v1/${PROJECT_ID}/volumes/${VOLUME_ID}/action \ -H "x-auth-token: ${ADMIN_AUTH_TOKEN}" \ -H 'content-type: application/json' \ -d '{"os-reset_status": {"status": "error"}}' The new admin only api can assist deployers who encounter bugs or operational issues that result in failed actions. It can also be used by future storage backends to support async callback style status updates from long running actions or operations which have encountered an error will be retried. Also updates the api.openstack.wsgi.ControllerMetaclass to support sub-classing wsgi.Controllers that define wsgi_actions. Partial fix for bug #1039706 Change-Id: If795599d5150dea362279d75a75276f3166d0149
* Add a resume delete on volume manager startupJohn Griffith2012-09-131-0/+6
| | | | | | | | | | | | | | | Currently if for some reason the volume service was stopped during the zero out operation of a volume delete there was no way to get the volume removed from the system (it would be present in deleting status forever). This change adds a simple check of volumes in the DB with status of deleting, and if any are found it restarts the delete process on them. addresses bug #1011150 Change-Id: I6aa26e9eaa94da4b620f01160931cbfcad9dadf7