From a0a3f0157d6f4e8563a5a1e4ee1bde92388f25fc Mon Sep 17 00:00:00 2001 From: "vladimir.p" Date: Mon, 25 Jul 2011 16:58:09 -0700 Subject: volume name change. some cleanup --- nova/db/sqlalchemy/models.py | 20 -------------------- nova/flags.py | 1 - nova/vsa/api.py | 12 ++++++++---- 3 files changed, 8 insertions(+), 25 deletions(-) diff --git a/nova/db/sqlalchemy/models.py b/nova/db/sqlalchemy/models.py index fbc8e9e19..42b97867d 100644 --- a/nova/db/sqlalchemy/models.py +++ b/nova/db/sqlalchemy/models.py @@ -279,14 +279,6 @@ class VirtualStorageArray(BASE, NovaBase): vol_count = Column(Integer, default=0) # total number of BE volumes status = Column(String(255)) - #admin_pass = Column(String(255)) - - #disks = relationship(VsaDiskAssociation, - # backref=backref('vsa', uselist=False), - # foreign_keys=id, - # primaryjoin='and_(VsaDiskAssociation.vsa_id == ' - # 'VirtualStorageArray.id)') - class InstanceActions(BASE, NovaBase): """Represents a guest VM's actions and results""" @@ -401,18 +393,6 @@ class DriveTypes(BASE, NovaBase): primaryjoin='and_(Volume.drive_type_id == ' 'DriveTypes.id)') -# -#class VsaDiskAssociation(BASE, NovaBase): -# """associates drive types with Virtual Storage Arrays.""" -# __tablename__ = 'vsa_disk_association' -# -# id = Column(Integer, primary_key=True, autoincrement=True) -# -# drive_type_id = Column(Integer, ForeignKey('drive_types.id')) -# vsa_id = Column(Integer, ForeignKey('virtual_storage_arrays.id')) -# -# disk_num = Column(Integer, nullable=False) # number of disks - class Quota(BASE, NovaBase): """Represents a single quota override for a project. diff --git a/nova/flags.py b/nova/flags.py index 9f5965919..c192b5281 100644 --- a/nova/flags.py +++ b/nova/flags.py @@ -369,7 +369,6 @@ DEFINE_string('vsa_manager', 'nova.vsa.manager.VsaManager', 'Manager for vsa') DEFINE_string('vc_image_name', 'vc_image', 'the VC image ID (for a VC image that exists in DB Glance)') -#--------------------------------------------------------------------- # VSA constants and enums DEFINE_string('default_vsa_instance_type', 'm1.small', 'default instance type for VSA instances') diff --git a/nova/vsa/api.py b/nova/vsa/api.py index 99793efa3..9b2750d82 100644 --- a/nova/vsa/api.py +++ b/nova/vsa/api.py @@ -67,7 +67,8 @@ class API(base.Base): return instance_types.get_instance_type_by_name( FLAGS.default_vsa_instance_type) - def _check_storage_parameters(self, context, vsa_name, storage, shared): + def _check_storage_parameters(self, context, vsa_name, storage, + shared, first_index=0): """ Translates storage array of disks to the list of volumes :param storage: List of dictionaries with following keys: @@ -105,13 +106,16 @@ class API(base.Base): size = 0 # special handling for full drives for i in range(num_volumes): - # VP-TODO: potentialy may conflict with previous volumes - volume_name = vsa_name + ("_%s_vol-%d" % (name, i)) + # volume_name = vsa_name + ("_%s_vol-%d" % (name, i)) + volume_name = "drive-%03d" % first_index + first_index += 1 + volume_desc = 'BE volume for VSA %s type %s' % \ + (vsa_name, name) volume = { 'size': size, 'snapshot_id': None, 'name': volume_name, - 'description': 'BE volume for ' + volume_name, + 'description': volume_desc, 'drive_ref': drive_ref } volume_params.append(volume) -- cgit