Example #1
0
    def _stop_osd(self, nodes, remove, drain):
        """Stop OSD service on the given nodes.
        
        The volume is always detached.
        
        If remove is True, the volume is destroyed and node and volume are 
        deleted from internal data structures.
        
        If drain is True, data is moved to other OSDs."""

        for node in nodes:
            try:
                client.stopOSD(node.ip, 5555, drain)
            except client.AgentException:
                self.logger.exception('Failed to stop OSD at node %s' % node)
                self.state = self.S_ERROR
                raise

            volume_id = self.osd_uuid_volume_map[self.osd_node_uuid_map[node.id]]
            self.detach_volume(volume_id)

            # destroy volumes and delete entries from internal state 
            if remove:
                self.destroy_volume(volume_id)
                del self.osd_uuid_volume_map[self.osd_node_uuid_map[node.id]]
                del self.osd_node_uuid_map[node.id]
            else:
                self.logger.debug('Not destroying volume %s' % volume_id)
Example #2
0
    def _stop_osd(self, nodes, remove, drain):
        """Stop OSD service on the given nodes.
        
        The volume is always detached.
        
        If remove is True, the volume is destroyed and node and volume are 
        deleted from internal data structures.
        
        If drain is True, data is moved to other OSDs."""

        for node in nodes:
            try:
                client.stopOSD(node.ip, 5555, drain)
            except client.AgentException:
                self.logger.exception('Failed to stop OSD at node %s' % node)
                self.state = self.S_ERROR
                raise

            volume_id = self.osd_uuid_volume_map[self.osd_node_uuid_map[
                node.id]]
            self.detach_volume(volume_id)

            # destroy volumes and delete entries from internal state
            if remove:
                self.destroy_volume(volume_id)
                del self.osd_uuid_volume_map[self.osd_node_uuid_map[node.id]]
                del self.osd_node_uuid_map[node.id]
            else:
                self.logger.debug('Not destroying volume %s' % volume_id)
Example #3
0
    def _stop_osd(self, nodes, drain=True, detach=True):
        """Stop OSD service on the given nodes.

        If drain is True, move data to other OSDs.

        If detach is True, detach associated storage volumes. If the service is
        set as not persistent, the volumes will also be permanently removed."""
        for node in nodes:
            try:
                client.stopOSD(node.ip, 5555, drain)
            except client.AgentException:
                self.logger.exception('Failed to stop OSD at node %s' % node)
                self.state = self.S_ERROR
                raise

            volume_id = self.osd_uuid_volume_map[self.osd_node_uuid_map[node.id]]

            if not detach:
                self.logger.debug('Not detaching volume %s' % volume_id)
                continue

            self.detach_volume(volume_id)

            # if the service is not persistent, delete the storage volume
            # associated with this node
            if not self.persistent:
                self.destroy_volume(volume_id)
Example #4
0
 def _stop_osd(self, nodes):
     for node in nodes:
         try:
             client.stopOSD(node.ip, 5555)
         except client.AgentException:
             self.logger.exception('Failed to stop OSD at node %s' % node)
             self.state = self.S_ERROR
             raise
Example #5
0
 def _stop_osd(self, nodes):
     for node in nodes:
         try:
             client.stopOSD(node.ip, 5555)
         except client.AgentException:
             self.logger.exception('Failed to stop OSD at node %s' % node)
             self.state = self.S_ERROR
             raise
Example #6
0
 def KillOsd(self, nodes):
     for node in nodes:
         client.stopOSD(node.ip, 5555)
         self.osdNodes.remove(node)
Example #7
0
 def KillOsd(self, nodes):
     for node in nodes:
         client.stopOSD(node.ip, 5555)
         self.osdNodes.remove(node)