Example #1
0
 def rm_func(vios_w):
     LOG.info("Removing SSP disk connection to VIOS %(vios)s.",
              {'vios': vios_w.name},
              instance=instance)
     return tsk_map.remove_maps(vios_w,
                                lpar_uuid,
                                match_func=match_func)
    def detach_disk(self, instance):
        """Detaches the storage adapters from the image disk.

        :param instance: Instance to disconnect the image for.
        :return: A list of all the backing storage elements that were
                 disconnected from the I/O Server and VM.
        """
        lpar_uuid = vm.get_pvm_uuid(instance)

        # Build the match function
        match_func = tsk_map.gen_match_func(pvm_stg.VDisk)

        vios_w = pvm_vios.VIOS.get(self._adapter,
                                   uuid=self._vios_uuid,
                                   xag=[pvm_const.XAG.VIO_SMAP])

        # Remove the mappings.
        mappings = tsk_map.remove_maps(vios_w,
                                       lpar_uuid,
                                       match_func=match_func)

        # Update the VIOS with the removed mappings.
        vios_w.update()

        return [x.backing_storage for x in mappings]
Example #3
0
 def rm_func(vios_w):
     LOG.info(
         _LI("Disconnecting instance %(inst)s from storage disks.") %
         {'inst': instance.name})
     return tsk_map.remove_maps(vios_w,
                                lpar_uuid,
                                match_func=match_func)
Example #4
0
 def rm_func(vios_w):
     LOG.info("Removing vSCSI mapping from physical volume %(dev)s "
              "on vios %(vios)s",
              {'dev': device_name, 'vios': vios_w.name},
              instance=self.instance)
     removed_maps = tsk_map.remove_maps(
         vios_w, vm_uuid,
         tsk_map.gen_match_func(pvm_stor.PV, names=[device_name]))
     return removed_maps
Example #5
0
 def rm_func(vios_w):
     LOG.info(_LI("Removing vSCSI mapping from Physical Volume %(dev)s "
                  "to VM %(vm)s") % {'dev': device_name, 'vm': vm_uuid})
     removed_maps = tsk_map.remove_maps(
         vios_w, vm_uuid,
         tsk_map.gen_match_func(pvm_stor.PV, names=[device_name]))
     for rm_map in removed_maps:
         slot_mgr.drop_vscsi_mapping(rm_map)
     return removed_maps
Example #6
0
 def rm_func(vios_w):
     LOG.info("Removing vSCSI mapping from physical volume %(dev)s "
              "on vios %(vios)s",
              {'dev': device_name, 'vios': vios_w.name},
              instance=self.instance)
     removed_maps = tsk_map.remove_maps(
         vios_w, vm_uuid,
         tsk_map.gen_match_func(pvm_stor.PV, names=[device_name]))
     return removed_maps
Example #7
0
 def rm_func(vios_w):
     LOG.info("Removing vSCSI mapping from physical volume %(dev)s.",
              {'dev': device_name},
              instance=self.instance)
     removed_maps = tsk_map.remove_maps(
         vios_w, vm_uuid,
         tsk_map.gen_match_func(pvm_stor.PV, names=[device_name]))
     for rm_map in removed_maps:
         slot_mgr.drop_vscsi_mapping(rm_map)
     return removed_maps
Example #8
0
 def rm_func(vios_w):
     LOG.info(
         _LI("Removing SSP disk connection between VM %(vm)s and "
             "VIOS %(vios)s."), {
                 'vm': instance.name,
                 'vios': vios_w.name
             })
     return tsk_map.remove_maps(vios_w,
                                lpar_uuid,
                                match_func=match_func)
Example #9
0
 def rm_func(vios_w):
     LOG.info(
         _LI("Removing vSCSI mapping from Physical Volume %(dev)s "
             "to VM %(vm)s") % {
                 'dev': device_name,
                 'vm': vm_uuid
             })
     return tsk_map.remove_maps(
         vios_w, vm_uuid,
         tsk_map.gen_match_func(pvm_stor.PV, names=[device_name]))
Example #10
0
        def rm_func(vios_w):
            # If the vios doesn't match, just return
            if vios_w.uuid != vios_uuid:
                return None

            LOG.info(_LI("Disconnecting instance %(inst)s from storage "
                         "disks."), {'inst': self.instance.name},
                     instance=self.instance)
            return tsk_map.remove_maps(vios_w,
                                       self.vm_uuid,
                                       match_func=match_func)
Example #11
0
        def rm_func(vios_w):
            # If the vios doesn't match, just return
            if vios_w.uuid not in self.vios_uuids:
                return None

            LOG.info("Disconnecting storage disks.", instance=self.instance)
            removed_maps = tsk_map.remove_maps(vios_w,
                                               self.vm_uuid,
                                               match_func=match_func)
            for rm_map in removed_maps:
                slot_mgr.drop_vscsi_mapping(rm_map)
            return removed_maps
Example #12
0
 def rm_func(vios_w):
     LOG.info(
         _LI("Removing vSCSI mapping from Physical Volume %(dev)s "
             "to VM %(vm)s"), {
                 'dev': device_name,
                 'vm': vm_uuid
             })
     removed_maps = tsk_map.remove_maps(
         vios_w, vm_uuid,
         tsk_map.gen_match_func(pvm_stor.PV, names=[device_name]))
     for rm_map in removed_maps:
         slot_mgr.drop_vscsi_mapping(rm_map)
     return removed_maps
Example #13
0
    def detach_disk(self, instance):
        """Detaches the storage adapters from the image disk.

        :param instance: Instance to disconnect the image for.
        :return: A list of all the backing storage elements that were
                 disconnected from the I/O Server and VM.
        """
        lpar_uuid = vm.get_pvm_uuid(instance)

        # Build the match function
        match_func = tsk_map.gen_match_func(pvm_stg.VDisk)

        vios_w = pvm_vios.VIOS.get(
            self._adapter, uuid=self._vios_uuid, xag=[pvm_const.XAG.VIO_SMAP])

        # Remove the mappings.
        mappings = tsk_map.remove_maps(
            vios_w, lpar_uuid, match_func=match_func)

        # Update the VIOS with the removed mappings.
        vios_w.update()

        return [x.backing_storage for x in mappings]
Example #14
0
 def rm_func(vios_w):
     LOG.info("Disconnecting instance from storage disks.",
              instance=instance)
     return tsk_map.remove_maps(vios_w, lpar_uuid,
                                match_func=match_func)
Example #15
0
 def rm_func(vios_w):
     LOG.info(_LI("Disconnecting instance %(inst)s from storage disks.")
              % {'inst': instance.name})
     return tsk_map.remove_maps(vios_w, lpar_uuid,
                                match_func=match_func)
Example #16
0
 def rm_func(vwrap):
     LOG.info("Removing SSP disk connection to VIOS %s.",
              vwrap.name,
              instance=instance)
     return tsk_map.remove_maps(vwrap, lpar_uuid, match_func=match_func)
Example #17
0
File: ssp.py Project: Juniper/nova
 def rm_func(vwrap):
     LOG.info("Removing SSP disk connection to VIOS %s.",
              vwrap.name, instance=instance)
     return tsk_map.remove_maps(vwrap, lpar_uuid,
                                match_func=match_func)
Example #18
0
 def rm_vopt_mapping(vios_w):
     return tsk_map.remove_maps(vios_w, lpar_uuid,
                                match_func=match_func)
Example #19
0
 def rm_vopt_mapping(vios_w):
     return tsk_map.remove_maps(vios_w, lpar_uuid,
                                match_func=match_func)
Example #20
0
 def rm_func(vios_w):
     LOG.info(_LI("Removing SSP disk connection between VM %(vm)s and "
                  "VIOS %(vios)s."),
              {'vm': instance.name, 'vios': vios_w.name})
     return tsk_map.remove_maps(vios_w, lpar_uuid,
                                match_func=match_func)
Example #21
0
 def rm_func(vios_w):
     LOG.info(
         _LI("Removing vSCSI mapping from Physical Volume %(dev)s " "to VM %(vm)s")
         % {"dev": device_name, "vm": vm_uuid}
     )
     return tsk_map.remove_maps(vios_w, vm_uuid, tsk_map.gen_match_func(pvm_stor.PV, names=[device_name]))