Example #1
0
    def vol_usage_update(
        self, context, vol_id, rd_req, rd_bytes, wr_req, wr_bytes, instance, last_refreshed=None, update_totals=False
    ):
        # The session object is needed here, as the vol_usage object returned
        # needs to bound to it in order to refresh its data
        session = db_session.get_session()
        vol_usage = self.db.vol_usage_update(
            context,
            vol_id,
            rd_req,
            rd_bytes,
            wr_req,
            wr_bytes,
            instance["uuid"],
            instance["project_id"],
            instance["user_id"],
            instance["availability_zone"],
            update_totals,
            session,
        )

        # We have just updated the database, so send the notification now
        notifier.notify(
            context,
            "conductor.%s" % self.host,
            "volume.usage",
            notifier.INFO,
            compute_utils.usage_volume_info(vol_usage),
        )
Example #2
0
    def vol_usage_update(
        self, context, vol_id, rd_req, rd_bytes, wr_req, wr_bytes, instance, last_refreshed=None, update_totals=False
    ):
        vol_usage = self.db.vol_usage_update(
            context,
            vol_id,
            rd_req,
            rd_bytes,
            wr_req,
            wr_bytes,
            instance["uuid"],
            instance["project_id"],
            instance["user_id"],
            instance["availability_zone"],
            update_totals,
        )

        # We have just updated the database, so send the notification now
        notifier.notify(
            context,
            "conductor.%s" % self.host,
            "volume.usage",
            notifier.INFO,
            compute_utils.usage_volume_info(vol_usage),
        )
Example #3
0
    def vol_usage_update(self, context, vol_id, rd_req, rd_bytes, wr_req,
                         wr_bytes, instance, last_refreshed, update_totals):
        vol_usage = self.db.vol_usage_update(
            context, vol_id, rd_req, rd_bytes, wr_req, wr_bytes,
            instance['uuid'], instance['project_id'], instance['user_id'],
            instance['availability_zone'], update_totals)

        # We have just updated the database, so send the notification now
        self.notifier.info(context, 'volume.usage',
                           compute_utils.usage_volume_info(vol_usage))
Example #4
0
    def vol_usage_update(self, context, vol_id, rd_req, rd_bytes, wr_req,
                         wr_bytes, instance, last_refreshed, update_totals):
        vol_usage = self.db.vol_usage_update(context, vol_id,
                                             rd_req, rd_bytes,
                                             wr_req, wr_bytes,
                                             instance['uuid'],
                                             instance['project_id'],
                                             instance['user_id'],
                                             instance['availability_zone'],
                                             update_totals)

        # We have just updated the database, so send the notification now
        self.notifier.info(context, 'volume.usage',
                           compute_utils.usage_volume_info(vol_usage))
Example #5
0
    def vol_usage_update(self, context, vol_id, rd_req, rd_bytes, wr_req,
                         wr_bytes, instance, last_refreshed=None,
                         update_totals=False):
        # The session object is needed here, as the vol_usage object returned
        # needs to bound to it in order to refresh its data
        session = db_session.get_session()
        vol_usage = self.db.vol_usage_update(context, vol_id,
                                             rd_req, rd_bytes,
                                             wr_req, wr_bytes,
                                             instance['uuid'],
                                             instance['project_id'],
                                             instance['user_id'],
                                             instance['availability_zone'],
                                             last_refreshed, update_totals,
                                             session)

        # We have just updated the database, so send the notification now
        notifier.notify(context, 'conductor.%s' % self.host, 'volume.usage',
                        notifier.INFO,
                        compute_utils.usage_volume_info(vol_usage))