ppc64le-cloud / pvsadm

Tool for managing the IBM Power Systems Virtual Servers
Apache License 2.0
37 stars 38 forks source link

RHEL 9.4 image Showing only 10GB of diskspace on / filesystem #620

Closed Poorna-Gottimukkula1 closed 4 months ago

Poorna-Gottimukkula1 commented 5 months ago

What happened:

The allocated size for the root directory (/) is 10 GB instead of 120 GB

[root@test-vm-rhel9-4 ~]# df -h
Filesystem           Size  Used Avail Use% Mounted on
devtmpfs             4.0M     0  4.0M   0% /dev
tmpfs                7.5G     0  7.5G   0% /dev/shm
tmpfs                3.0G   25M  3.0G   1% /run
/dev/mapper/mpatha3   10G  1.9G  8.2G  19% /
/dev/mapper/mpatha2  960M  189M  772M  20% /boot
tmpfs                1.5G     0  1.5G   0% /run/user/0
[root@test-vm-rhel9-4 ~]#

What you expected to happen: The expected root file system size should be 120 GB

How to reproduce it (as minimally and precisely as possible):

Example:

./bin/pvsadm image qcow2ova --image-name rhel-94-04242024 --image-dist rhel --rhn-user ***** --rhn-password **** --image-url ./rhel-9.4-ppc64le-kvm.qcow2

Anything else we need to know?:

I can see that the partition number hardcode with 2 https://github.com/ppc64le-cloud/pvsadm/blob/main/cmd/image/qcow2ova/prep/templates.go#L148-L169, we may need to change this to 3 since rhel 9.x images are having the root file system on partition number 3

Environment:

KeerthanaAP commented 5 months ago

/assign

KeerthanaAP commented 5 months ago

Thanks @Poorna-Gottimukkula1 for creating this issue. As you have mentioned we have to update the partition number in update-disks script. In rhel 9.* we have 3 partitions in all disk, partition 2 is mapped for /boot and partition 3 is for /.

[root@testvm ~]# lsblk 
NAME        MAJ:MIN RM  SIZE RO TYPE  MOUNTPOINTS
sda           8:0    0  120G  0 disk  
├─sda1        8:1    0    4M  0 part  
├─sda2        8:2    0    1G  0 part  
├─sda3        8:3    0  119G  0 part  
└─mpatha    253:0    0  120G  0 mpath 
  ├─mpatha1 253:1    0    4M  0 part  
  ├─mpatha2 253:2    0    1G  0 part  /boot
  └─mpatha3 253:3    0  119G  0 part  /
sdb           8:16   0  120G  0 disk  
├─sdb1        8:17   0    4M  0 part  
├─sdb2        8:18   0    1G  0 part  
├─sdb3        8:19   0  119G  0 part  
└─mpatha    253:0    0  120G  0 mpath 
  ├─mpatha1 253:1    0    4M  0 part  
  ├─mpatha2 253:2    0    1G  0 part  /boot
  └─mpatha3 253:3    0  119G  0 part  /
sdc           8:32   0  120G  0 disk  
├─sdc1        8:33   0    4M  0 part  
├─sdc2        8:34   0    1G  0 part  
├─sdc3        8:35   0  119G  0 part  
└─mpatha    253:0    0  120G  0 mpath 
  ├─mpatha1 253:1    0    4M  0 part  
  ├─mpatha2 253:2    0    1G  0 part  /boot
  └─mpatha3 253:3    0  119G  0 part  /
sdd           8:48   0  120G  0 disk  
├─sdd1        8:49   0    4M  0 part  
├─sdd2        8:50   0    1G  0 part  
├─sdd3        8:51   0  119G  0 part  
└─mpatha    253:0    0  120G  0 mpath 
  ├─mpatha1 253:1    0    4M  0 part  
  ├─mpatha2 253:2    0    1G  0 part  /boot
  └─mpatha3 253:3    0  119G  0 part  /
sde           8:64   0  120G  0 disk  
├─sde1        8:65   0    4M  0 part  
├─sde2        8:66   0    1G  0 part  
├─sde3        8:67   0  119G  0 part  
└─mpatha    253:0    0  120G  0 mpath 
  ├─mpatha1 253:1    0    4M  0 part  
  ├─mpatha2 253:2    0    1G  0 part  /boot
  └─mpatha3 253:3    0  119G  0 part  /
sdf           8:80   0  120G  0 disk  
├─sdf1        8:81   0    4M  0 part  
├─sdf2        8:82   0    1G  0 part  
├─sdf3        8:83   0  119G  0 part  
└─mpatha    253:0    0  120G  0 mpath 
  ├─mpatha1 253:1    0    4M  0 part  
  ├─mpatha2 253:2    0    1G  0 part  /boot
  └─mpatha3 253:3    0  119G  0 part  /
sdg           8:96   0  120G  0 disk  
├─sdg1        8:97   0    4M  0 part  
├─sdg2        8:98   0    1G  0 part  
├─sdg3        8:99   0  119G  0 part  
└─mpatha    253:0    0  120G  0 mpath 
  ├─mpatha1 253:1    0    4M  0 part  
  ├─mpatha2 253:2    0    1G  0 part  /boot
  └─mpatha3 253:3    0  119G  0 part  /
sdh           8:112  0  120G  0 disk  
├─sdh1        8:113  0    4M  0 part  
├─sdh2        8:114  0    1G  0 part  
├─sdh3        8:115  0  119G  0 part  
└─mpatha    253:0    0  120G  0 mpath 
  ├─mpatha1 253:1    0    4M  0 part  
  ├─mpatha2 253:2    0    1G  0 part  /boot
  └─mpatha3 253:3    0  119G  0 part  /
sr0          11:0    1  506K  0 rom 

In the existing script to grow partitions explicitly we have hardcoded 2 which is /boot in case of all rhel 9.* images but we need to grow / which is the last partition of disk. Updated the script in this PR.

Poorna-Gottimukkula1 commented 5 months ago

cc: @sudeeshjohn

mkumatag commented 4 months ago

Already fixed part of #623