Skip to content

Instantly share code, notes, and snippets.

View ancorgs's full-sized avatar

Ancor Gonzalez Sosa ancorgs

  • Suse Linux Gmbh
  • Las Palmas de Gran Canaria
View GitHub Profile
---
- disk:
name: /dev/sda
size: 1 TiB
partition_table: ms-dos
partitions:
- partition:
size: 2 GiB
name: /dev/sda1
@ancorgs
ancorgs / example.rb
Last active March 7, 2016 07:28
Devicegraphs global catalog
# The first line is the one that makes me feel that the global catalog and the problem
# of everybody happily accessing StorageManager.instance are back
# It fakes the hardware probing (Why if I only want to work with YAML files?)
# It initializes StorageManager.instance, which is not named explicitily (...is not needed
# because "everybody know about it")
# It registers a graph in the global name-indexed catalog (named "fake")
fake_probing = Yast::Storage::FakeProbing.new
# Returns that devicegraph called "fake"
graph1 = fake_probing.devicegraph
# This is a follow up on https://gist.github.com/ancorgs/c371a33177c6cf8d6d8e
# Yes Josef, instead of 2 lines, I would also prefer something like
# graph1 = BlaBlaFactory.load_yaml_file(input_file1)
# But that's not the point here
graph1 = Storage::Devicegraph.new
Yast::Storage::FakeDeviceFactory.load_yaml_file(graph1,input_file1)
graph2 = Storage::Devicegraph.new
Yast::Storage::FakeDeviceFactory.load_yaml_file(graph2,input_file2)
query = DevicegraphQuery.new(a_devicegraph)
fine_query = query.with_disk(name: ["/dev/sda", "/dev/sdb"])
more_fine_query = fine_query.with_partition(type: :primary)
part_query = query.with_partition(name: ["/dev/sda2", "/dev/sdc3"])
# All these calls return arrays
query.filesystems # all the file systems in the devicegraph
fine_query.filesystems # Filesystems in the chosen disks
more_fine_query.filesystems # fs in primary parts of chosen disks
part_query.filesystems # Filesystems in sda2 and sdc3
query = DevicegraphQuery.new(a_devicegraph)
disk_query = query.disks # A DiskQuery object
disk_query = disk_query.with(name: ["/dev/sda", "/dev/sdb"]) # Another DiskQuery object
part_fine_query = disk_query.partitions.with(type: :primary) # A PartitionQuery object
part_query = query.partitions.with(name: ["/dev/sda2", "/dev/sdc3"])
# equivalent line
# part_query = PartitionQuery.new(a_devicegraph).with(name: ["/dev/sda2", "/dev/sdc3"])
# Calls to whatever.filesystems returns a FilesystemQuery object which is Enumerable
# So the equivalent to previous example (https://gist.github.com/ancorgs/9c628ef0f4fa717a2817) would be

needed_partitions in a PPC64 system

  • in a non-PowerNV system (KVM/LPAR)
    • with a partitions-based proposal
      • if there are no PReP partitions
        • requires only a PReP partition
      • if the existent PReP partition is not in the target disk
        • requires only a PReP partition
      • if there is already a PReP partition in the disk
  • does not require any particular volume

needed_partitions in a PPC64 system

  • in a non-PowerNV system (KVM/LPAR)
    • with a partitions-based proposal
      • if there are no PReP partitions
        • requires only a PReP partition
      • if the existent PReP partition is not in the target disk
        • requires only a PReP partition
      • if there is already a PReP partition in the disk
  • does not require any particular volume
@ancorgs
ancorgs / boot-rspec.md
Created July 12, 2016 16:13
Candidate RSpec output (manually ajusted) for storage-ng booting

needed_partitions in a PPC64 system

  • in a non-PowerNV system (KVM/LPAR)
    • with a partitions-based proposal
      • if there are no PReP partitions
        • requires only a PReP partition
      • if the existent PReP partition is not in the target disk
        • requires only a PReP partition
      • if there is already a PReP partition in the disk
  • does not require any particular volume

needed_partitions in a PPC64 system

  • in a non-PowerNV system (KVM/LPAR)
    • with a partitions-based proposal
      • if there are no PReP partitions
        • requires only a PReP partition
      • if the existent PReP partition is not in the target disk
        • requires only a PReP partition
      • if there is already a PReP partition in the disk
  • does not require any particular volume

What should go to SP2 branch?

As I understand, only stuff relevant for SP2 itself (good reason for it to be in a future MU)

What should go to CASP branch?

Everything that goes to SP2 + CASP specific stuff

Versions