Permalink
Browse files

removes the nova-volume code from nova

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
  • Loading branch information...
1 parent 4e449c0 commit 7e2b93acc59dea81d52684f7f659fcff32507e14 @vishvananda vishvananda committed Oct 24, 2012
Showing with 110 additions and 17,830 deletions.
  1. +2 −2 bin/nova-all
  2. +0 −46 bin/nova-api-os-volume
  3. +0 −28 bin/nova-manage
  4. +0 −50 bin/nova-volume
  5. +0 −81 bin/nova-volume-usage-audit
  6. +0 −8 doc/api_samples/all_extensions/extensions-get-resp.json
  7. +0 −3 doc/api_samples/all_extensions/extensions-get-resp.xml
  8. +0 −6 doc/source/conf.py
  9. +3 −4 doc/source/devref/architecture.rst
  10. +0 −2 doc/source/devref/index.rst
  11. +4 −6 doc/source/devref/rpc.rst
  12. +0 −52 doc/source/devref/volume.rst
  13. +0 −88 doc/source/devref/xensmvolume.rst
  14. +0 −49 doc/source/man/nova-api-os-volume.rst
  15. +2 −2 doc/source/man/nova-rootwrap.rst
  16. +0 −61 doc/source/man/nova-volume-usage-audit.rst
  17. +0 −54 doc/source/man/nova-volume.rst
  18. +0 −36 etc/nova/rootwrap.d/volume.filters
  19. +0 −7 nova/api/openstack/compute/contrib/volumes.py
  20. +0 −225 nova/api/openstack/compute/contrib/volumetypes.py
  21. +0 −68 nova/api/openstack/volume/__init__.py
  22. +0 −39 nova/api/openstack/volume/contrib/__init__.py
  23. +0 −129 nova/api/openstack/volume/contrib/admin_actions.py
  24. +0 −31 nova/api/openstack/volume/contrib/image_create.py
  25. +0 −149 nova/api/openstack/volume/contrib/types_extra_specs.py
  26. +0 −91 nova/api/openstack/volume/contrib/types_manage.py
  27. +0 −131 nova/api/openstack/volume/contrib/volume_actions.py
  28. +0 −34 nova/api/openstack/volume/extensions.py
  29. +0 −185 nova/api/openstack/volume/snapshots.py
  30. +0 −80 nova/api/openstack/volume/types.py
  31. +0 −83 nova/api/openstack/volume/versions.py
  32. +0 −16 nova/api/openstack/volume/views/__init__.py
  33. +0 −34 nova/api/openstack/volume/views/types.py
  34. +0 −36 nova/api/openstack/volume/views/versions.py
  35. +0 −364 nova/api/openstack/volume/volumes.py
  36. +2 −18 nova/flags.py
  37. +0 −2 nova/network/manager.py
  38. +2 −18 nova/scheduler/driver.py
  39. +0 −9 nova/service.py
  40. +3 −11 nova/tests/api/ec2/test_cinder_cloud.py
  41. +37 −539 nova/tests/api/ec2/test_cloud.py
  42. +0 −1 nova/tests/api/ec2/test_ec2_validate.py
  43. +9 −7 nova/tests/api/openstack/compute/contrib/test_snapshots.py
  44. +0 −224 nova/tests/api/openstack/compute/contrib/test_volume_types.py
  45. +0 −198 nova/tests/api/openstack/compute/contrib/test_volume_types_extra_specs.py
  46. +7 −8 nova/tests/api/openstack/compute/contrib/test_volumes.py
  47. +0 −1 nova/tests/api/openstack/compute/test_extensions.py
  48. +0 −1 nova/tests/api/openstack/fakes.py
  49. +0 −19 nova/tests/api/openstack/volume/__init__.py
  50. +0 −19 nova/tests/api/openstack/volume/contrib/__init__.py
  51. +0 −184 nova/tests/api/openstack/volume/contrib/test_admin_actions.py
  52. +0 −226 nova/tests/api/openstack/volume/contrib/test_types_extra_specs.py
  53. +0 −122 nova/tests/api/openstack/volume/contrib/test_types_manage.py
  54. +0 −162 nova/tests/api/openstack/volume/contrib/test_volume_actions.py
  55. +0 −15 nova/tests/api/openstack/volume/extensions/__init__.py
  56. +0 −94 nova/tests/api/openstack/volume/extensions/foxinsocks.py
  57. +0 −155 nova/tests/api/openstack/volume/test_extensions.py
  58. +0 −112 nova/tests/api/openstack/volume/test_router.py
  59. +0 −299 nova/tests/api/openstack/volume/test_snapshots.py
  60. +0 −194 nova/tests/api/openstack/volume/test_types.py
  61. +0 −602 nova/tests/api/openstack/volume/test_volumes.py
  62. +29 −31 nova/tests/compute/test_compute.py
  63. +0 −2 nova/tests/fake_flags.py
  64. +9 −5 nova/tests/fake_volume.py
  65. +0 −8 nova/tests/integrated/api_samples/all_extensions/extensions-get-resp.json.tpl
  66. +0 −3 nova/tests/integrated/api_samples/all_extensions/extensions-get-resp.xml.tpl
  67. +0 −3 nova/tests/integrated/integrated_helpers.py
  68. +0 −181 nova/tests/integrated/test_volumes.py
  69. +0 −70 nova/tests/scheduler/test_scheduler.py
  70. +0 −3 nova/tests/test_cinder.py
  71. +0 −121 nova/tests/test_iscsi.py
  72. +0 −1 nova/tests/test_libvirt.py
  73. +0 −1,380 nova/tests/test_netapp.py
  74. +0 −234 nova/tests/test_netapp_nfs.py
  75. +0 −278 nova/tests/test_nexenta.py
  76. +0 −569 nova/tests/test_nfs.py
  77. +0 −1 nova/tests/test_plugin_api_extensions.py
  78. +0 −23 nova/tests/test_quota.py
  79. +0 −161 nova/tests/test_rbd.py
  80. +0 −208 nova/tests/test_solidfire.py
  81. +0 −1,376 nova/tests/test_storwize_svc.py
  82. +0 −931 nova/tests/test_volume.py
  83. +0 −167 nova/tests/test_volume_types.py
  84. +0 −130 nova/tests/test_volume_types_extra_specs.py
  85. +0 −91 nova/tests/test_volume_utils.py
  86. +1 −1 nova/tests/test_xenapi.py
  87. +0 −140 nova/tests/test_xensm.py
  88. +0 −209 nova/tests/volume/test_HpSanISCSIDriver.py
  89. +0 −511 nova/volume/api.py
  90. +0 −452 nova/volume/manager.py
  91. +0 −1,291 nova/volume/netapp.py
  92. +0 −267 nova/volume/netapp_nfs.py
  93. +0 −33 nova/volume/nexenta/__init__.py
  94. +0 −84 nova/volume/nexenta/jsonrpc.py
  95. +0 −282 nova/volume/nexenta/volume.py
  96. +0 −293 nova/volume/nfs.py
  97. +0 −651 nova/volume/san.py
  98. +0 −424 nova/volume/solidfire.py
  99. +0 −1,233 nova/volume/storwize_svc.py
  100. +0 −84 nova/volume/utils.py
  101. +0 −125 nova/volume/volume_types.py
  102. +0 −250 nova/volume/xensm.py
  103. +0 −3 setup.py
View
@@ -70,8 +70,8 @@ if __name__ == '__main__':
except (Exception, SystemExit):
LOG.exception(_('Failed to load %s') % mod.__name__)
- for binary in ['nova-compute', 'nova-volume',
- 'nova-network', 'nova-scheduler', 'nova-cert']:
+ for binary in ['nova-compute', 'nova-network', 'nova-scheduler',
+ 'nova-cert']:
try:
launcher.launch_server(service.Service.create(binary=binary))
except (Exception, SystemExit):
View
@@ -1,46 +0,0 @@
-#!/usr/bin/env python
-# vim: tabstop=4 shiftwidth=4 softtabstop=4
-
-# Copyright 2010 United States Government as represented by the
-# Administrator of the National Aeronautics and Space Administration.
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-"""Starter script for Nova OS API."""
-
-import eventlet
-eventlet.monkey_patch(os=False)
-
-import os
-import sys
-
-
-possible_topdir = os.path.normpath(os.path.join(os.path.abspath(
- sys.argv[0]), os.pardir, os.pardir))
-if os.path.exists(os.path.join(possible_topdir, "nova", "__init__.py")):
- sys.path.insert(0, possible_topdir)
-
-
-from nova import flags
-from nova.openstack.common import log as logging
-from nova import service
-from nova import utils
-
-if __name__ == '__main__':
- flags.parse_args(sys.argv)
- logging.setup("nova")
- utils.monkey_patch()
- server = service.WSGIService('osapi_volume')
- service.serve(server, workers=server.workers)
- service.wait()
View
@@ -777,33 +777,6 @@ class VersionCommands(object):
self.list()
-class VolumeCommands(object):
- """Methods for dealing with a cloud in an odd state"""
-
- @args('--volume', dest='volume_id', metavar='<volume id>',
- help='Volume ID')
- def reattach(self, volume_id):
- """Re-attach a volume that has previously been attached
- to an instance. Typically called after a compute host
- has been rebooted."""
-
- if 'cinder' in FLAGS.volume_api_class:
- print(_("\"nova-manage volume reattach\" only valid "
- "when using nova-volume service"))
- sys.exit(1)
-
- ctxt = context.get_admin_context()
- volume = db.volume_get(ctxt, param2id(volume_id))
-
- if not volume['instance_id']:
- print _("volume is not attached to an instance")
- return
- instance = db.instance_get(ctxt, volume['instance_id'])
- rpcapi = compute_rpcapi.ComputeAPI()
- rpcapi.attach_volume(ctxt, instance, volume['id'],
- volume['mountpoint'])
-
-
class InstanceTypeCommands(object):
"""Class for managing instance types / flavors."""
@@ -1207,7 +1180,6 @@ CATEGORIES = [
('sm', StorageManagerCommands),
('version', VersionCommands),
('vm', VmCommands),
- ('volume', VolumeCommands),
('vpn', VpnCommands),
]
View
@@ -1,50 +0,0 @@
-#!/usr/bin/env python
-# vim: tabstop=4 shiftwidth=4 softtabstop=4
-
-# Copyright 2010 United States Government as represented by the
-# Administrator of the National Aeronautics and Space Administration.
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-
-"""Starter script for Nova Volume."""
-
-import eventlet
-eventlet.monkey_patch()
-
-import os
-import sys
-
-# If ../nova/__init__.py exists, add ../ to Python search path, so that
-# it will override what happens to be installed in /usr/(local/)lib/python...
-possible_topdir = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]),
- os.pardir,
- os.pardir))
-if os.path.exists(os.path.join(possible_topdir, 'nova', '__init__.py')):
- sys.path.insert(0, possible_topdir)
-
-
-from nova import flags
-from nova.openstack.common import log as logging
-from nova import service
-from nova import utils
-
-if __name__ == '__main__':
- flags.parse_args(sys.argv)
- FLAGS = flags.FLAGS
- logging.setup("nova")
- utils.monkey_patch()
- server = service.Service.create(binary='nova-volume',
- topic=FLAGS.volume_topic)
- service.serve(server)
- service.wait()
@@ -1,81 +0,0 @@
-#!/usr/bin/env python
-# vim: tabstop=4 shiftwidth=4 softtabstop=4
-
-# Copyright (c) 2011 OpenStack, LLC.
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-
-"""Cron script to generate usage notifications for volumes existing during
- the audit period.
-
- Together with the notifications generated by volumes
- create/delete/resize, over that time period, this allows an external
- system consuming usage notification feeds to calculate volume usage
- for each tenant.
-
- Time periods are specified as 'hour', 'month', 'day' or 'year'
-
- hour = previous hour. If run at 9:07am, will generate usage for 8-9am.
- month = previous month. If the script is run April 1, it will generate
- usages for March 1 through March 31.
- day = previous day. if run on July 4th, it generates usages for July 3rd.
- year = previous year. If run on Jan 1, it generates usages for
- Jan 1 through Dec 31 of the previous year.
-"""
-
-import datetime
-import gettext
-import os
-import sys
-import time
-import traceback
-
-# If ../nova/__init__.py exists, add ../ to Python search path, so that
-# it will override what happens to be installed in /usr/(local/)lib/python...
-POSSIBLE_TOPDIR = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]),
- os.pardir,
- os.pardir))
-if os.path.exists(os.path.join(POSSIBLE_TOPDIR, 'nova', '__init__.py')):
- sys.path.insert(0, POSSIBLE_TOPDIR)
-
-gettext.install('nova', unicode=1)
-from nova import context
-from nova import db
-from nova import exception
-from nova import flags
-from nova.openstack.common import log as logging
-from nova.openstack.common import rpc
-from nova import utils
-from nova.volume import utils as volume_utils
-
-FLAGS = flags.FLAGS
-
-if __name__ == '__main__':
- admin_context = context.get_admin_context()
- flags.FLAGS(sys.argv)
- logging.setup("nova")
- begin, end = utils.last_completed_audit_period()
- print _("Starting volume usage audit")
- print _("Creating usages for %s until %s") % (str(begin), str(end))
- volumes = db.volume_get_active_by_window(admin_context,
- begin,
- end)
- print _("Found %d volumes") % len(volumes)
- for volume_ref in volumes:
- try:
- volume_utils.notify_usage_exists(
- admin_context, volume_ref)
- except Exception, e:
- print traceback.format_exc(e)
- print _("Volume usage audit completed")
@@ -329,14 +329,6 @@
"updated": "2011-08-17T00:00:00+00:00"
},
{
- "alias": "os-volume-types",
- "description": "Volume types support",
- "links": [],
- "name": "VolumeTypes",
- "namespace": "http://docs.openstack.org/compute/ext/volume_types/api/v1.1",
- "updated": "2011-08-24T00:00:00+00:00"
- },
- {
"alias": "os-volumes",
"description": "Volumes support",
"links": [],
@@ -137,9 +137,6 @@
<extension alias="os-virtual-interfaces" updated="2011-08-17T00:00:00+00:00" namespace="http://docs.openstack.org/compute/ext/virtual_interfaces/api/v1.1" name="VirtualInterfaces">
<description>Virtual interface support</description>
</extension>
- <extension alias="os-volume-types" updated="2011-08-24T00:00:00+00:00" namespace="http://docs.openstack.org/compute/ext/volume_types/api/v1.1" name="VolumeTypes">
- <description>Volume types support</description>
- </extension>
<extension alias="os-volumes" updated="2011-03-25T00:00:00+00:00" namespace="http://docs.openstack.org/compute/ext/volumes/api/v1.1" name="Volumes">
<description>Volumes support</description>
</extension>
View
@@ -127,8 +127,6 @@
[u'OpenStack'], 1),
('man/nova-api-os-compute', 'nova-api-os-compute',
u'Cloud controller fabric', [u'OpenStack'], 1),
- ('man/nova-api-os-volume', 'nova-api-os-volume',
- u'Cloud controller fabric', [u'OpenStack'], 1),
('man/nova-api', 'nova-api', u'Cloud controller fabric',
[u'OpenStack'], 1),
('man/nova-cert', 'nova-cert', u'Cloud controller fabric',
@@ -155,10 +153,6 @@
[u'OpenStack'], 1),
('man/nova-scheduler', 'nova-scheduler', u'Cloud controller fabric',
[u'OpenStack'], 1),
- ('man/nova-volume-usage-audit', 'nova-volume-usage-audit', u'Cloud controller fabric',
- [u'OpenStack'], 1),
- ('man/nova-volume', 'nova-volume', u'Cloud controller fabric',
- [u'OpenStack'], 1),
('man/nova-xvpvncproxy', 'nova-xvpvncproxy', u'Cloud controller fabric',
[u'OpenStack'], 1)
]
@@ -33,8 +33,8 @@ Below you will find a helpful explanation of the different components.
[ Auth Manager ] ---
| \- ( DB )
|
- | [ scheduler ] - [ volume ] - ( iSCSI )
- | /
+ |
+ |
[ Web Dashboard ] -> [ api ] -- < AMQP > ------ [ network ] - ( Flat/Vlan )
| \
< HTTP > [ scheduler ] - [ compute ] - ( libvirt/xen )
@@ -46,7 +46,6 @@ Below you will find a helpful explanation of the different components.
* api: component that receives http requests, converts commands and communicates with other components via the queue or http (in the case of objectstore)
* Auth Manager: component responsible for users/projects/and roles. Can backend to DB or LDAP. This is not a separate binary, but rather a python class that is used by most components in the system.
* objectstore: http server that replicates s3 api and allows storage and retrieval of images
-* scheduler: decides which host gets each vm and volume
-* volume: manages dynamically attachable block devices.
+* scheduler: decides which host gets each vm
* network: manages ip forwarding, bridges, and vlans
* compute: manages communication with hypervisor and virtual machines.
@@ -67,8 +67,6 @@ Module Reference
services
database
- volume
- xensmvolume
compute
network
api
View
@@ -30,12 +30,12 @@ Nova uses direct, fanout, and topic-based exchanges. The architecture looks like
..
-Nova implements RPC (both request+response, and one-way, respectively nicknamed 'rpc.call' and 'rpc.cast') over AMQP by providing an adapter class which take cares of marshaling and unmarshaling of messages into function calls. Each Nova service (for example Compute, Volume, etc.) create two queues at the initialization time, one which accepts messages with routing keys 'NODE-TYPE.NODE-ID' (for example compute.hostname) and another, which accepts messages with routing keys as generic 'NODE-TYPE' (for example compute). The former is used specifically when Nova-API needs to redirect commands to a specific node like 'euca-terminate instance'. In this case, only the compute node whose host's hypervisor is running the virtual machine can kill the instance. The API acts as a consumer when RPC calls are request/response, otherwise is acts as publisher only.
+Nova implements RPC (both request+response, and one-way, respectively nicknamed 'rpc.call' and 'rpc.cast') over AMQP by providing an adapter class which take cares of marshaling and unmarshaling of messages into function calls. Each Nova service (for example Compute, Scheduler, etc.) create two queues at the initialization time, one which accepts messages with routing keys 'NODE-TYPE.NODE-ID' (for example compute.hostname) and another, which accepts messages with routing keys as generic 'NODE-TYPE' (for example compute). The former is used specifically when Nova-API needs to redirect commands to a specific node like 'euca-terminate instance'. In this case, only the compute node whose host's hypervisor is running the virtual machine can kill the instance. The API acts as a consumer when RPC calls are request/response, otherwise is acts as publisher only.
Nova RPC Mappings
-----------------
-The figure below shows the internals of a message broker node (referred to as a RabbitMQ node in the diagrams) when a single instance is deployed and shared in an OpenStack cloud. Every Nova component connects to the message broker and, depending on its personality (for example a compute node or a network node), may use the queue either as an Invoker (such as API or Scheduler) or a Worker (such as Compute, Volume or Network). Invokers and Workers do not actually exist in the Nova object model, but we are going to use them as an abstraction for sake of clarity. An Invoker is a component that sends messages in the queuing system via two operations: 1) rpc.call and ii) rpc.cast; a Worker is a component that receives messages from the queuing system and reply accordingly to rcp.call operations.
+The figure below shows the internals of a message broker node (referred to as a RabbitMQ node in the diagrams) when a single instance is deployed and shared in an OpenStack cloud. Every Nova component connects to the message broker and, depending on its personality (for example a compute node or a network node), may use the queue either as an Invoker (such as API or Scheduler) or a Worker (such as Compute or Network). Invokers and Workers do not actually exist in the Nova object model, but we are going to use them as an abstraction for sake of clarity. An Invoker is a component that sends messages in the queuing system via two operations: 1) rpc.call and ii) rpc.cast; a Worker is a component that receives messages from the queuing system and reply accordingly to rcp.call operations.
Figure 2 shows the following internal elements:
@@ -97,10 +97,8 @@ The figure below shows the status of a RabbitMQ node after Nova components' boot
2. compute
3. network.phantom (phantom is hostname)
4. network
- 5. volume.phantom (phantom is hostname)
- 6. volume
- 7. scheduler.phantom (phantom is hostname)
- 8. scheduler
+ 5. scheduler.phantom (phantom is hostname)
+ 6. scheduler
.. image:: /images/rpc/state.png
:width: 60%
@@ -1,52 +0,0 @@
-..
- Copyright 2010-2011 United States Government as represented by the
- Administrator of the National Aeronautics and Space Administration.
- All Rights Reserved.
-
- Licensed under the Apache License, Version 2.0 (the "License"); you may
- not use this file except in compliance with the License. You may obtain
- a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- License for the specific language governing permissions and limitations
- under the License.
-
-Storage Volumes, Disks
-======================
-
-.. todo:: rework after iSCSI merge (see 'Old Docs') (todd or vish)
-
-
-The :mod:`nova.volume.manager` Module
--------------------------------------
-
-.. automodule:: nova.volume.manager
- :noindex:
- :members:
- :undoc-members:
- :show-inheritance:
-
-The :mod:`nova.volume.driver` Module
--------------------------------------
-
-.. automodule:: nova.volume.driver
- :noindex:
- :members:
- :undoc-members:
- :show-inheritance:
-
-Tests
------
-
-The :mod:`volume_unittest` Module
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-.. automodule:: nova.tests.volume_unittest
- :noindex:
- :members:
- :undoc-members:
- :show-inheritance:
Oops, something went wrong.

0 comments on commit 7e2b93a

Please sign in to comment.