Merge "Fix resize volume stuck in "RESIZE" status"

This commit is contained in:
Jenkins 2013-08-16 02:07:26 +00:00 committed by Gerrit Code Review
commit aa5c3ddf1b
2 changed files with 11 additions and 2 deletions

View File

@ -14,6 +14,7 @@
import traceback
from cinderclient import exceptions as cinder_exceptions
from eventlet import greenthread
from novaclient import exceptions as nova_exceptions
from trove.common import cfg
@ -454,7 +455,15 @@ class BuiltInstanceTasks(BuiltInstance, NotifyMixin, ConfigurationMixin):
LOG.debug("%s: Resizing volume for instance: %s from %s to %r GB"
% (greenthread.getcurrent(), self.server.id,
old_volume_size, new_size))
self.volume_client.volumes.resize(self.volume_id, new_size)
try:
self.volume_client.volumes.extend(self.volume_id, new_size)
except cinder_exceptions.ClientException:
self.update_db(task_status=inst_models.InstanceTasks.NONE)
LOG.exception("Error encountered trying to rescan or resize the "
"attached volume filesystem for volume: "
"%s" % self.volume_id)
raise
try:
utils.poll_until(
lambda: self.volume_client.volumes.get(self.volume_id),

View File

@ -497,7 +497,7 @@ class FakeVolumes(object):
def list(self, detailed=True):
return [self.db[key] for key in self.db]
def resize(self, volume_id, new_size):
def extend(self, volume_id, new_size):
LOG.debug("Resize volume id (%s) to size (%s)" % (volume_id, new_size))
volume = self.get(volume_id)