Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: mdadm extension #271

Merged
merged 1 commit into from
Nov 26, 2023
Merged

feat: mdadm extension #271

merged 1 commit into from
Nov 26, 2023

Conversation

sergelogvinov
Copy link
Contributor

Add mdadm tool in root filesystem.

@sergelogvinov sergelogvinov force-pushed the md-adm branch 4 times, most recently from a4915ec to 9e17433 Compare November 22, 2023 21:20
@frezbo
Copy link
Member

frezbo commented Nov 23, 2023

is there a way to test this from talos side, would love to add some tests here: https://github.com/siderolabs/talos/blob/main/internal/integration/api/extensions_qemu.go already have a set of helpers and tests here, should be easy to add

@sergelogvinov
Copy link
Contributor Author

Ready to go:

# talosctl --talosconfig _cfgs/talosconfig --nodes 192.168.10.48 get extensions                                                                    
NODE            NAMESPACE   TYPE              ID                                                               VERSION   NAME    VERSION
192.168.10.48   runtime     ExtensionStatus   000.ghcr.io-sergelogvinov-mdadm-v4.2-v1.6.0-alpha.2-2-gc74d8e1   1         mdadm   v4.2-v1.6.0-alpha.2-2-gc74d8e1

# talosctl --talosconfig _cfgs/talosconfig --nodes 192.168.10.48 disks         
NODE            DEV        MODEL           SERIAL   TYPE   UUID   WWID   MODALIAS      NAME   SIZE    BUS_PATH                                                                                SUBSYSTEM          SYSTEM_DISK
192.168.10.48   /dev/sda   QEMU HARDDISK   -        SSD    -      -      scsi:t-0x00   -      34 GB   /pci0000:00/0000:00:1e.0/0000:05:01.0/0000:06:05.0/virtio1/host6/target6:0:0/6:0:0:0/   /sys/class/block   *
192.168.10.48   /dev/sdb   QEMU HARDDISK   -        SSD    -      -      scsi:t-0x00   -      11 GB   /pci0000:00/0000:00:1e.0/0000:05:01.0/0000:06:05.0/virtio1/host6/target6:0:0/6:0:0:2/   /sys/class/block   
192.168.10.48   /dev/sdc   QEMU HARDDISK   -        SSD    -      -      scsi:t-0x00   -      11 GB   /pci0000:00/0000:00:1e.0/0000:05:01.0/0000:06:05.0/virtio1/host6/target6:0:0/6:0:0:1/   /sys/class/block   

# talosctl --talosconfig _cfgs/talosconfig --nodes 192.168.10.48 mounts | grep '/dev/md'
192.168.10.48   /dev/md127p1                 10.67      0.11       10.56           1.03%          /var/data

# mdadm --detail /dev/md127
/dev/md127:
           Version : 0.90
     Creation Time : Wed Nov 22 18:21:41 2023
        Raid Level : raid1
        Array Size : 10485696 (10.00 GiB 10.74 GB)
     Used Dev Size : 10485696 (10.00 GiB 10.74 GB)
      Raid Devices : 2
     Total Devices : 2
   Preferred Minor : 127
       Persistence : Superblock is persistent

       Update Time : Thu Nov 23 19:25:57 2023
             State : clean 
    Active Devices : 2
   Working Devices : 2
    Failed Devices : 0
     Spare Devices : 0

Consistency Policy : resync

              UUID : 86345734:5d4de8db:5a848257:e2917ea5 (local to host controlplane-41)
            Events : 0.24

    Number   Major   Minor   RaidDevice State
       0       8       32        0      active sync   /dev/sdc
       1       8       16        1      active sync   /dev/sdb

@sergelogvinov sergelogvinov marked this pull request as ready for review November 23, 2023 19:28
@sergelogvinov
Copy link
Contributor Author

is there a way to test this from talos side, would love to add some tests here: https://github.com/siderolabs/talos/blob/main/internal/integration/api/extensions_qemu.go already have a set of helpers and tests here, should be easy to add

The first idea that comes to my mind is to check for the binary existence.
All other checks can be done only with extra disk (two or more) Maybe loop devices helps...

@frezbo
Copy link
Member

frezbo commented Nov 24, 2023

All other checks can be done only with extra disk (two or more) Maybe loop devices helps...

the extensions test mount up extra disks, if you look at zfs tests we run commands to create a pool and verify it's still mounted after a reboot, i think we should add something similar along the lines for mdadm too

@frezbo
Copy link
Member

frezbo commented Nov 24, 2023

All other checks can be done only with extra disk (two or more) Maybe loop devices helps...

the extensions test mount up extra disks, if you look at zfs tests we run commands to create a pool and verify it's still mounted after a reboot, i think we should add something similar along the lines for mdadm too

Just saw the readme, i can add a test in Talos

@frezbo
Copy link
Member

frezbo commented Nov 24, 2023

I'll try building this and add a test to talos to test, then merge it

Add mdadm tool in root filesystem.

Signed-off-by: Serge Logvinov <[email protected]>
Signed-off-by: Noel Georgi <[email protected]>
@frezbo
Copy link
Member

frezbo commented Nov 26, 2023

/ok-to-test

@frezbo
Copy link
Member

frezbo commented Nov 26, 2023

/m

@talos-bot talos-bot merged commit 7618f8f into siderolabs:main Nov 26, 2023
2 checks passed
@sergelogvinov sergelogvinov deleted the md-adm branch November 26, 2023 09:40
talos-bot pushed a commit to siderolabs/talos that referenced this pull request Nov 27, 2023
Add tests for mdadm extension.

See: siderolabs/extensions#271

Signed-off-by: Noel Georgi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants