Ejemplo n.º 1
0
    def create_volume(self,
                      context,
                      topic,
                      volume_id,
                      snapshot_id=None,
                      image_id=None,
                      request_spec=None,
                      filter_properties=None,
                      volume=None):

        self._wait_for_scheduler()

        # FIXME(thangp): Remove this in v2.0 of RPC API.
        if volume is None:
            # For older clients, mimic the old behavior and look up the
            # volume by its volume_id.
            volume = objects.Volume.get_by_id(context, volume_id)

        try:
            flow_engine = create_volume.get_flow(context, db, self.driver,
                                                 request_spec,
                                                 filter_properties, volume,
                                                 snapshot_id, image_id)
        except Exception:
            msg = _("Failed to create scheduler manager volume flow")
            LOG.exception(msg)
            raise exception.CinderException(msg)

        with flow_utils.DynamicLogListener(flow_engine, logger=LOG):
            flow_engine.run()
Ejemplo n.º 2
0
    def create_volume(self, context, topic, volume_id, snapshot_id=None,
                      image_id=None, request_spec=None,
                      filter_properties=None, volume=None):

        self._wait_for_scheduler()

        # FIXME(dulek): Remove this in v3.0 of RPC API.
        if volume is None:
            # For older clients, mimic the old behavior and look up the
            # volume by its volume_id.
            volume = objects.Volume.get_by_id(context, volume_id)

        # FIXME(dulek): Remove this in v3.0 of RPC API.
        if isinstance(request_spec, dict):
            # We may receive request_spec as dict from older clients.
            request_spec = objects.RequestSpec.from_primitives(request_spec)

        try:
            flow_engine = create_volume.get_flow(context,
                                                 db, self.driver,
                                                 request_spec,
                                                 filter_properties,
                                                 volume,
                                                 snapshot_id,
                                                 image_id)
        except Exception:
            msg = _("Failed to create scheduler manager volume flow")
            LOG.exception(msg)
            raise exception.CinderException(msg)

        with flow_utils.DynamicLogListener(flow_engine, logger=LOG):
            flow_engine.run()
Ejemplo n.º 3
0
    def create_volume(
        self, context, topic, volume_id, snapshot_id=None, image_id=None, request_spec=None, filter_properties=None
    ):

        try:
            flow_engine = create_volume.get_flow(
                context, db, self.driver, request_spec, filter_properties, volume_id, snapshot_id, image_id
            )
        except Exception:
            LOG.exception(_("Failed to create scheduler manager volume flow"))
            raise exception.CinderException(_("Failed to create scheduler manager volume flow"))

        with flow_utils.DynamicLogListener(flow_engine, logger=LOG):
            flow_engine.run()
Ejemplo n.º 4
0
    def create_volume(self, context, topic, volume_id, snapshot_id=None,
                      image_id=None, request_spec=None,
                      filter_properties=None):

        try:
            flow_engine = create_volume.get_flow(context,
                                                 db, self.driver,
                                                 request_spec,
                                                 filter_properties,
                                                 volume_id,
                                                 snapshot_id,
                                                 image_id)
        except Exception:
            LOG.exception(_("Failed to create scheduler manager volume flow"))
            raise exception.CinderException(
                _("Failed to create scheduler manager volume flow"))
        flow_engine.run()
Ejemplo n.º 5
0
    def create_volume(self, context, volume, snapshot_id=None, image_id=None,
                      request_spec=None, filter_properties=None):
        self._wait_for_scheduler()

        try:
            flow_engine = create_volume.get_flow(context,
                                                 self.driver,
                                                 request_spec,
                                                 filter_properties,
                                                 volume,
                                                 snapshot_id,
                                                 image_id)
        except Exception:
            msg = _("Failed to create scheduler manager volume flow")
            LOG.exception(msg)
            raise exception.CinderException(msg)

        with flow_utils.DynamicLogListener(flow_engine, logger=LOG):
            flow_engine.run()
Ejemplo n.º 6
0
    def create_volume(self, context, volume, snapshot_id=None, image_id=None,
                      request_spec=None, filter_properties=None,
                      backup_id=None):
        self._wait_for_scheduler()

        try:
            flow_engine = create_volume.get_flow(context,
                                                 self.driver,
                                                 request_spec,
                                                 filter_properties,
                                                 volume,
                                                 snapshot_id,
                                                 image_id,
                                                 backup_id)
        except Exception:
            msg = _("Failed to create scheduler manager volume flow")
            LOG.exception(msg)
            raise exception.CinderException(msg)

        with flow_utils.DynamicLogListener(flow_engine, logger=LOG):
            flow_engine.run()