Skip to content

Commit

Permalink
Allow to use a disk as a MdMember
Browse files Browse the repository at this point in the history
  • Loading branch information
imobachgs committed Oct 2, 2018
1 parent aa152dc commit 9fcdcdc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
5 changes: 1 addition & 4 deletions src/lib/y2storage/proposal/autoinst_devices_creator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ def process_partitions(planned_devices, disk_names)
# @return [Array<Array<Planned::Md>, Array<Planned::Md>, CreatorResult>]
def process_mds(planned_devices, devs_to_reuse, creator_result)
mds_to_reuse, mds_to_create = planned_devices.mds.partition(&:reuse?)
# TODO: currently it is not possible to use full disks in a RAID
devs_to_reuse_in_md = reusable_by_md(devs_to_reuse)
creator_result.merge!(create_mds(mds_to_create, creator_result, devs_to_reuse_in_md))
mds_to_reuse.each { |i| i.reuse!(creator_result.devicegraph) }
Expand Down Expand Up @@ -304,9 +303,7 @@ def flexible_devices(devices)
# @param planned_devices [Planned::DevicesCollection] collection of planned devices
# @return [Array<Planned::Device>]
def reusable_by_md(planned_devices)
planned_devices.select do |dev|
dev.is_a?(Planned::StrayBlkDevice) || dev.is_a?(Planned::Partition)
end
planned_devices.select { |d| d.respond_to?(:raid_name) }
end
end
end
Expand Down
1 change: 1 addition & 0 deletions src/lib/y2storage/proposal/autoinst_disk_device_planner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ def planned_for_full_disk(drive, part)
planned_disk = Y2Storage::Planned::Disk.new
device_config(planned_disk, part, drive)
planned_disk.lvm_volume_group_name = part.lvm_group
planned_disk.raid_name = part.raid_name
add_device_reuse(planned_disk, drive.device, part)

[planned_disk]
Expand Down

0 comments on commit 9fcdcdc

Please sign in to comment.