예제 #1
0
 def post_protect(self, cntx, workload_action_excution_id, resource_id):
     LOG.debug("post protecting instance %s" % (resource_id))
     instance = self.clients.nova().servers.get(resource_id)
     instance.unpause()
     instance_snapshot_execution =\
         ae.ActionExecution(workload_action_excution_id,
                            resource_id, self.id)
     instance_snapshot_execution.set_status(cntx, 'un-pausing VM')
예제 #2
0
    def pre_protect(self, cntx, workload_action_excution_id, resource_id):
        LOG.debug("pre protecting instance %s" % (resource_id))
        instance = self.clients.nova().servers.get(resource_id)
        # TODO(IBM): check instance state before pausing + passing original
        #               state to post_protect
        status = instance.pause()

        instance_snapshot_execution =\
            ae.ActionExecution(workload_action_excution_id,
                               resource_id, self.id)
        instance_snapshot_execution.set_status(cntx, 'pausing VM')
예제 #3
0
 def protect(self, cntx, workload_action_excution_id, resource_id,
             container_name):
     LOG.debug("protecting instance %s" % (resource_id))
     instance = self.clients.nova().servers.get(resource_id)
     self._image_id = instance.image['id']
     self._name = instance.name
     self._resource_id = resource_id
     instance_snapshot_exection =\
         ae.ActionExecution(workload_action_excution_id,
                            resource_id, self.id)
     result = self._snapshot(cntx, instance, container_name,
                             instance_snapshot_exection)
     return result
    def protect(self, cntx, workload_action_excution_id, resource_id,
                container_name):
        volume = self.clients.cinder().volumes.get(resource_id)

        self._name = volume.name
        self._id = volume.id
        self._resource_id = resource_id

        volume_snapshot_exection =\
            ae.ActionExecution(workload_action_excution_id,
                               resource_id, self.id)
        result = self._replicate_volume_to_DR(cntx, volume, container_name,
                                              volume_snapshot_exection)
        return result
예제 #5
0
    def protect(self, context, workload_action_excution_id, resource_id,
                container_name):
        volume = self.clients.cinder().volumes.get(resource_id)

        self._name = volume.name
        self._id = volume.id
        self._resource_id = resource_id

        volume_snapshot_exection =\
            ae.ActionExecution(workload_action_excution_id,
                               resource_id, self.id)

        dr_state = "Protected"
        # TODO(IBM): should the dr_state reflect the drbd state?
        # if yes - how do we validate drbd driver is alive and working?
        volume_snapshot_exection.set_status(context, dr_state)

        backup_rec = {}
        backup_rec["metadata"] = volume.metadata
        backup_rec["volume_type"] = volume.volume_type
        backup_rec["volume_name"] = self._name
        return dr_state, backup_rec