Exemple #1
0
    def __lvm_raid_setup(self,
                         lvm):
        dl = DeviceList(self.spec,
                        lvm_context = (self.disk_array, lvm))
        r=RaidArray()
        r.fill_from_system_info (dl,
                                 lvm.get_name(),
                                 lvm.get_devname(),
                                 lvm.get_fstype(),
                                 lvm.get_ptype(),
                                 lvm.get_layout(),
                                 lvm.get_type(),
                                 lvm.get_size_mb(),
				 lvm.get_sysfscfg_list())
        self.raid_arrays.add_array(r)
Exemple #2
0
    def __legacy_volume_setup(self, 
                              zone):
        dz = DiskZone(zone, self.disk_array)
        self.__zone_map[dz.get_name()] = dz
        zda = dz.get_disk_array()

        for array in zone.get_raid_arrays():
            dl = DeviceList(self.spec,
                            zone_context = (zda, array))
            r=RaidArray()
            r.fill_from_system_info (dl,
                                     array.get_name(),
                                     array.get_rdev(),
                                     array.get_fstype(),
                                     array.get_ptype(),
                                     array.get_layout(),
                                     array.get_type(),
                                     array.get_cfg_size())
            self.raid_arrays.add_array(r)
            dz.add_raid_array(r)

        for ftraid in zone.get_ftraid_arrays():
            dl = DeviceList(self.spec,
                            zone_context = (zda, ftraid))
            ftarr = FtRaidArray(dl,
                                ftraid.get_name())
            self.__ftraid_arrays.append(ftarr)
            dz.add_ftraid_array(ftarr)

        # XXX/munirb: No need for further processing if the zone is FTS
        # Bug 46944: It will add an extra line for segstore to -l and 
        # -u queries which isnt correct for fts models as they 
        # have segstore on multiple disks
        if zone.get_name() == 'fts':
            return

        for vol in zone.get_volumes():
            # volumes are single device exports, without a raid/storage 
            # service

            hd  = self.disk_array.get_drive_list()[0]
            if (int(hd.portnum) == 0) and self.managed_disk(int(hd.portnum)):
                # All BOB and VSH based models

                # Do not assume that the second disk is the disk 
                # that needs partitioning, run through the loop of 
                # all the disks to check if they are managed or not and 
                # partition accordingly For Bluegill machines, the volume 
                # should be added just once even though there may be 
                # multiple disks in the system. The reasoning is that 
                # the volumes aren't RAID'ed for these models so we 
                # do not create a md device for them, this causes 
                # the volumes list to show duplicate entries (rrdm_tool -l)
                p = ''
                for hd in self.disk_array.get_drive_list():
                    if self.managed_disk(int(hd.portnum)):
                        continue
                    else:
                        p = Partition()
                        p.make_partition(vol.get_part_id(),
                                         vol.get_part_size(zone),
                                         vol.get_ptype(),
                                         hd,
                                         vol.get_name(),
                                         vol.get_fstype())
                        self.volumes.append(p)
            else:
                # 1050H case, the second disk is not managed, but will 
                # be setup by hal
                p = Partition()
                p.make_partition(vol.get_part_id(),
                                 vol.get_part_size(zone),
                                 vol.get_ptype(),
                                 hd,
                                 vol.get_name(),
                                 vol.get_fstype())
                self.volumes.append(p)