vol['availability_zone'] = FLAGS.storage_availability_zone
vol['status'] = "creating"
vol['attach_status'] = "detached"
+ vol['host'] = FLAGS.host
if metadata is not None:
vol['metadata'] = metadata
return db.volume_create(context.get_admin_context(), vol)
snapshot_ref = self.db.snapshot_get(context, snapshot_id)
src_volume_ref = self.db.volume_get(context,
snapshot_ref['volume_id'])
- volume_ref = self.db.volume_get(context,
- volume_id)
+ now = timeutils.utcnow()
+ values = {'host': src_volume_ref['host'], 'scheduled_at': now}
+ volume_ref = self.db.volume_update(context, volume_id, values)
+
# bypass scheduler and send request directly to volume
self.volume_rpcapi.create_volume(context,
volume_ref,
- src_volume_ref['host'],
+ volume_ref['host'],
snapshot_id,
image_id)
else:
self._notify_about_volume_usage(context, volume_ref, "create.start")
LOG.info(_("volume %s: creating"), volume_ref['name'])
- self.db.volume_update(context,
- volume_id,
- {'host': self.host})
# NOTE(vish): so we don't have to get volume from db again
# before passing it to the driver.
volume_ref['host'] = self.host