lsst-uk / somerville-operations

User issue reporting and tracking for the Somerville Cloud
0 stars 0 forks source link

New volume on sv-admin-0 for upgrade works #94

Closed GregBlow closed 1 year ago

GregBlow commented 1 year ago

fdisk -l before:

[root@sv-admin-0 ~]# fdisk -l
Disk /dev/sda: 223.6 GiB, 240021504000 bytes, 468792000 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 262144 bytes / 262144 bytes
Disklabel type: gpt
Disk identifier: B7C127FA-35A1-4F94-BBF2-4D06D944EE27

Device       Start       End   Sectors  Size Type
/dev/sda1     2048   1230847   1228800  600M EFI System
/dev/sda2  1230848   3327999   2097152    1G Linux filesystem
/dev/sda3  3328000 363935743 360607744  172G Linux LVM

Disk /dev/mapper/cs-root: 20 GiB, 21474836480 bytes, 41943040 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 262144 bytes / 262144 bytes

Disk /dev/mapper/cs-swap: 4 GiB, 4294967296 bytes, 8388608 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 262144 bytes / 262144 bytes

Disk /dev/mapper/cs-home: 20 GiB, 21474836480 bytes, 41943040 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 262144 bytes / 262144 bytes

Disk /dev/mapper/cs-libvirt--storage: 128 GiB, 137384427520 bytes, 268328960 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 262144 bytes / 262144 bytes
GregBlow commented 1 year ago
[root@sv-admin-0 ~]# lsblk
NAME                    MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda                       8:0    0 223.6G  0 disk
├─sda1                    8:1    0   600M  0 part /boot/efi
├─sda2                    8:2    0     1G  0 part /boot
└─sda3                    8:3    0   172G  0 part
  ├─cs-root             253:0    0    20G  0 lvm  /
  ├─cs-swap             253:1    0     4G  0 lvm  [SWAP]
  ├─cs-home             253:2    0    20G  0 lvm  /home
  └─cs-libvirt--storage 253:3    0   128G  0 lvm  /var/lib/libvirt/images
sdc                       8:32   0   1.1T  0 disk
GregBlow commented 1 year ago

sv-seed-vm-0 will live on this new volume, which will not be redundant. Therefore:

1) sv-seed-vm will be backed up to sv-sms-0-0 according to https://www.wiki.ed.ac.uk/pages/viewpage.action?pageId=568835285 2) at some point in the future this volume should be architected to be redundant as per https://github.com/lsst-uk/somerville-operations/issues/96

GregBlow commented 1 year ago

https://www.golinuxhub.com/2018/04/how-to-migrate-move-logical-volumes-and-volume-group-disk/

GregBlow commented 1 year ago

Need to verify backup process runs at 04:00 automatically 02/05/2023

GregBlow commented 1 year ago
[root@sv-admin-0 ~]# lvs -o+devices
  LV              VG Attr       LSize    Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert Devices
  home            cs -wi-ao----   20.00g                                                     /dev/sdb3(1024)
  libvirt-storage cs -wi-ao---- <127.95g                                                     /dev/sdb3(6144)
  root            cs -wi-ao----   20.00g                                                     /dev/sdb3(38899)
  swap            cs -wi-ao----    4.00g                                                     /dev/sdb3(0)
[root@sv-admin-0 ~]# df -h
Filesystem                       Size  Used Avail Use% Mounted on
devtmpfs                          47G     0   47G   0% /dev
tmpfs                             47G   84K   47G   1% /dev/shm
tmpfs                             47G   66M   47G   1% /run
tmpfs                             47G     0   47G   0% /sys/fs/cgroup
/dev/mapper/cs-root               20G  8.3G   12G  42% /
/dev/sdb2                       1014M  433M  582M  43% /boot
/dev/mapper/cs-libvirt--storage  128G  126G  2.6G  99% /var/lib/libvirt/images
/dev/sdb1                        599M  7.3M  592M   2% /boot/efi
/dev/mapper/cs-home               20G  9.5G   11G  48% /home
tmpfs                            9.4G     0  9.4G   0% /run/user/1001
tmpfs                            9.4G  4.0K  9.4G   1% /run/user/1000
GregBlow commented 1 year ago
[root@sv-admin-0 ~]# md5sum /var/lib/libvirt/images/sv-seed-vm-0-configdrive
e2811ded99e8e86424be182568501aff  /var/lib/libvirt/images/sv-seed-vm-0-configdrive
[root@sv-admin-0 ~]# lsscsi
[0:0:0:0]    disk    Generic- SD/MMC CRW       1.00  /dev/sdc
[1:0:0:0]    disk    HPE      EG001200JXLWA    HPD8  /dev/sda
[1:0:1:0]    enclosu HPE      Smart Adapter    3.53  -
[1:1:0:0]    disk    HPE      LOGICAL VOLUME   3.53  /dev/sdb
[1:2:0:0]    storage HPE      E208i-a SR Gen10 3.53  -
[root@sv-admin-0 ~]# pvs
  PV         VG Fmt  Attr PSize    PFree
  /dev/sda1     lvm2 ---     1.09t 1.09t
  /dev/sdb3  cs lvm2 a--  <171.95g    0
GregBlow commented 1 year ago
[root@sv-admin-0 ~]# vgextend cs /dev/sda1
  Volume group "cs" successfully extended
GregBlow commented 1 year ago
[root@sv-admin-0 ~]# vgdisplay cs -v
  --- Volume group ---
  VG Name               cs
  System ID
  Format                lvm2
  Metadata Areas        2
  Metadata Sequence No  13
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                4
  Open LV               4
  Max PV                0
  Cur PV                2
  Act PV                2
  VG Size               <1.26 TiB
  PE Size               4.00 MiB
  Total PE              330178
  Alloc PE / Size       44019 / <171.95 GiB
  Free  PE / Size       286159 / 1.09 TiB
  VG UUID               nhKgpn-qkse-cLjF-mHa4-4oE2-sr1R-jdCzIK

  --- Logical volume ---
  LV Path                /dev/cs/swap
  LV Name                swap
  VG Name                cs
  LV UUID                G9paCZ-dECc-hK9p-htJZ-pipa-t0Z6-3Gc2M5
  LV Write Access        read/write
  LV Creation host, time localhost, 2021-09-24 10:59:24 +0000
  LV Status              available
  # open                 2
  LV Size                4.00 GiB
  Current LE             1024
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     8192
  Block device           253:1

  --- Logical volume ---
  LV Path                /dev/cs/home
  LV Name                home
  VG Name                cs
  LV UUID                9jR0eX-lXKB-iZDF-VlAY-m4Xy-7xlK-Fdizr1
  LV Write Access        read/write
  LV Creation host, time localhost, 2021-09-24 10:59:24 +0000
  LV Status              available
  # open                 1
  LV Size                20.00 GiB
  Current LE             5120
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     8192
  Block device           253:2

  --- Logical volume ---
  LV Path                /dev/cs/root
  LV Name                root
  VG Name                cs
  LV UUID                RDtgP0-airm-5xdf-TciT-d1W0-rNJ2-uJZoNg
  LV Write Access        read/write
  LV Creation host, time localhost, 2021-09-24 10:59:24 +0000
  LV Status              available
  # open                 1
  LV Size                20.00 GiB
  Current LE             5120
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     8192
  Block device           253:0

  --- Logical volume ---
  LV Path                /dev/cs/libvirt-storage
  LV Name                libvirt-storage
  VG Name                cs
  LV UUID                xYcXEK-1Wml-C7kO-W8Oz-LPi1-tvb0-lsCGQN
  LV Write Access        read/write
  LV Creation host, time sv-admin-0, 2021-10-18 16:11:01 +0000
  LV Status              available
  # open                 1
  LV Size                <127.95 GiB
  Current LE             32755
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     8192
  Block device           253:3

  --- Physical volumes ---
  PV Name               /dev/sdb3
  PV UUID               M1fwqu-buJJ-IDbf-645W-A9DG-HHK5-eXoNhz
  PV Status             allocatable
  Total PE / Free PE    44019 / 0

  PV Name               /dev/sda1
  PV UUID               4OKeST-w423-ep2R-cHNq-3RMY-8Sde-PX2ek8
  PV Status             allocatable
  Total PE / Free PE    286159 / 286159
GregBlow commented 1 year ago
[root@sv-admin-0 ~]# lvs -o+devices
  LV              VG Attr       LSize    Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert Devices
  home            cs -wi-ao----   20.00g                                                     /dev/sdb3(1024)
  libvirt-storage cs -wi-ao---- <127.95g                                                     /dev/sdb3(6144)
  root            cs -wi-ao----   20.00g                                                     /dev/sdb3(38899)
  swap            cs -wi-ao----    4.00g                                                     /dev/sdb3(0)
[root@sv-admin-0 ~]# dmsetup deps /dev/cs/libvirt-storage
1 dependencies  : (8, 19)
GregBlow commented 1 year ago
[root@sv-admin-0 ~]# md5sum /var/lib/libvirt/images/sv-seed-vm-0-configdrive
e2811ded99e8e86424be182568501aff  /var/lib/libvirt/images/sv-seed-vm-0-configdrive
GregBlow commented 1 year ago
[root@sv-admin-0 ~]# dmsetup deps /dev/cs/libvirt-storage
2 dependencies  : (253, 5) (253, 4)
[root@sv-admin-0 ~]# ls -l /dev/ | grep sd
brw-rw----  1 root disk      8,   0 May 24 19:36 sda
brw-rw----  1 root disk      8,   1 Jun  5 16:15 sda1
brw-rw----  1 root disk      8,  16 May 24 19:36 sdb
brw-rw----  1 root disk      8,  17 May 24 19:36 sdb1
brw-rw----  1 root disk      8,  18 May 24 19:36 sdb2
brw-rw----  1 root disk      8,  19 Jun  5 16:15 sdb3
brw-rw----  1 root disk      8,  32 May 24 19:36 sdc
[root@sv-admin-0 ~]# lvs -o+devices
  LV              VG Attr       LSize    Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert Devices
  home            cs -wi-ao----   20.00g                                                     /dev/sdb3(1024)
  libvirt-storage cs mwi-aom--- <127.95g                                    100.00           libvirt-storage_mimage_0(0),libvirt-storage_mimage_1(0)
  root            cs -wi-ao----   20.00g                                                     /dev/sdb3(38899)
  swap            cs -wi-ao----    4.00g                                                     /dev/sdb3(0)
GregBlow commented 1 year ago
[root@sv-admin-0 ~]# lvconvert -m 0 cs/libvirt-storage /dev/sdb3
  Logical volume cs/libvirt-storage converted.
[root@sv-admin-0 ~]# lvs -o+devices
  LV              VG Attr       LSize    Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert Devices
  home            cs -wi-ao----   20.00g                                                     /dev/sdb3(1024)
  libvirt-storage cs -wi-ao---- <127.95g                                                     /dev/sda1(0)
  root            cs -wi-ao----   20.00g                                                     /dev/sdb3(38899)
  swap            cs -wi-ao----    4.00g                                                     /dev/sdb3(0)
GregBlow commented 1 year ago
[root@sv-admin-0 ~]# lvextend -l +50%FREE /dev/cs/libvirt-storage
  Size of logical volume cs/libvirt-storage changed from <127.95 GiB (32755 extents) to <686.86 GiB (175835 extents).
  Logical volume cs/libvirt-storage successfully resized.
[root@sv-admin-0 ~]# xfs_growfs /dev/cs/libvirt-storage
meta-data=/dev/mapper/cs-libvirt--storage isize=512    agcount=21, agsize=1638400 blks
         =                       sectsz=4096  attr=2, projid32bit=1
         =                       crc=1        finobt=1, sparse=1, rmapbt=0
         =                       reflink=1    bigtime=0 inobtcount=0
data     =                       bsize=4096   blocks=33541120, imaxpct=25
         =                       sunit=64     swidth=64 blks
naming   =version 2              bsize=4096   ascii-ci=0, ftype=1
log      =internal log           bsize=4096   blocks=12800, version=2
         =                       sectsz=4096  sunit=1 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
data blocks changed from 33541120 to 180055040
[root@sv-admin-0 ~]# df -h
Filesystem                       Size  Used Avail Use% Mounted on
devtmpfs                          47G     0   47G   0% /dev
tmpfs                             47G   84K   47G   1% /dev/shm
tmpfs                             47G   66M   47G   1% /run
tmpfs                             47G     0   47G   0% /sys/fs/cgroup
/dev/mapper/cs-root               20G  8.3G   12G  42% /
/dev/sdb2                       1014M  433M  582M  43% /boot
/dev/mapper/cs-libvirt--storage  687G  130G  558G  19% /var/lib/libvirt/images
/dev/sdb1                        599M  7.3M  592M   2% /boot/efi
/dev/mapper/cs-home               20G  9.5G   11G  48% /home
tmpfs                            9.4G     0  9.4G   0% /run/user/1001
tmpfs                            9.4G  4.0K  9.4G   1% /run/user/1000