ppc64le-cloud / pvsadm

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

pvsadm image build fails for redhat images with error Error: failed while preparing the image for rhel distro, err: failed to growpart for the device: /dev/loop0 and partition: 2, exitcode: 1, stdout: NOCHANGE: partition 2 is size 2097152. it cannot be grown , err: #613

Closed janagoudarniroop closed 3 months ago

janagoudarniroop commented 4 months ago

What happened: Currently using pvsadm tool to build rhel 9-4 power images and is currently failing as its not able to expand the /dev/loop devices. cloud-utils-growpart is already installed on the system and and temporary filesystem of 300GB has been atatched. Command used : pvsadm image qcow2ova --image-name <image-name> --image-url ./<rhel-9-4-qcow2> --image-dist rhel --image-size 100 --rhn-user <rhel-username> --rhn-password <rhel-password> --os-password <password> --temp-dir /rhel_tmp --prep-template <template-script>

Error: failed while preparing the image for rhel distro, err: failed to growpart for the device: /dev/loop0 and partition: 2, exitcode: 1, stdout: NOCHANGE: partition 2 is size 2097152. it cannot be grown
, err: 

What you expected to happen: Resolve the issue as the /dev/loop devices are getting created automatically on every run and its failing to expand .

How to reproduce it (as minimally and precisely as possible): Try building a rhel image using pvsadm tool

pvsadm image qcow2ova --image-name <image-name> --image-url ./<rhel-9-4-qcow2> --image-dist rhel --image-size 100 --rhn-user <rhel-username> --rhn-password <rhel-password> --os-password <password> --temp-dir /rhel_tmp --prep-template <template-script>

Anything else we need to know?:

Environment:

pvsadm version
Version: v0.1, GoVersion: go1.15.5
root@rhel-build-server pvsadm_power]# cat /etc/os-release 
NAME="Red Hat Enterprise Linux"
VERSION="8.9 (Ootpa)"
ID="rhel"
ID_LIKE="fedora"
VERSION_ID="8.9"
PLATFORM_ID="platform:el8"
PRETTY_NAME="Red Hat Enterprise Linux 8.9 (Ootpa)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:redhat:enterprise_linux:8::baseos"
HOME_URL="https://www.redhat.com/"
DOCUMENTATION_URL="https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8"
BUG_REPORT_URL="https://bugzilla.redhat.com/"

REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 8"
REDHAT_BUGZILLA_PRODUCT_VERSION=8.9
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="8.9"
uname -a
Linux rhel-build-server.power-iaas.cloud.ibm.com 4.18.0-477.51.1.el8_8.ppc64le #1 SMP Fri Mar 1 11:20:14 EST 2024 ppc64le ppc64le ppc64le GNU/Linux
mkumatag commented 4 months ago

cc @sudeeshjohn

mkumatag commented 4 months ago

@janagoudarniroop you can you please try installing the latest version and retry? the version you installed is very old.

KeerthanaAP commented 3 months ago

I tried reproducing the issue with the latest version but couldn't reproduce this issue. I am able to convert 9.4 image successfully.

[root@keerthana-vm bin]# ./pvsadm image qcow2ova --image-name testrhel94 --image-url /root/rhel-9.4-ppc64le-kvm.qcow2 --image-dist rhel
W0523 10:52:41.292063  114183 qcow2ova.go:125] rhn-user and rhn-password options are mandatory when image-dist is rhel, please enter the details
✗ Enter the RHN Username: █
Enter the RHN Username: rh-ee-karumuga
✗ Enter the RHN Password: █
Enter the RHN Password: •••••••••••••••
I0523 10:52:54.765562  114183 qcow2ova.go:179] Autogenerated OS root password is updated in /root/pvsadm/bin/password.txt
I0523 10:52:54.765599  114183 validate.go:40] Checking: platform
I0523 10:52:54.765609  114183 validate.go:40] Checking: user
I0523 10:52:54.765618  114183 validate.go:40] Checking: image-name
I0523 10:52:54.765636  114183 validate.go:40] Checking: tools
I0523 10:52:54.765679  114183 tools.go:43] qemu-img found at /usr/bin/qemu-img
I0523 10:52:54.765748  114183 tools.go:43] growpart found at /usr/bin/growpart
I0523 10:52:54.765757  114183 validate.go:40] Checking: diskspace
I0523 10:52:54.765774  114183 diskspace.go:50] free: 91G, need: 61G
I0523 10:52:54.767222  114183 qcow2ova.go:252] Converting Qcow2(/tmp/qcow2ova856919849/rhel-9.4-ppc64le-kvm.qcow2) image to raw(/tmp/qcow2ova856919849/ova-img-dir/testrhel94-disk.raw) format
I0523 10:52:57.512521  114183 qcow2ova.go:257] Conversion completed
.
.
.
.
Complete!
Generating initramfs for kernel version: 5.14.0-427.13.1.el9_4.ppc64le
Generating initramfs for kernel version: 5.14.0-427.18.1.el9_4.ppc64le
Generating grub configuration file ...
Found Red Hat Enterprise Linux 8.10 (Ootpa) on /dev/loop0p2
Found Red Hat Enterprise Linux 9.4 (Plow) on /dev/loop1p3
Found Red Hat Enterprise Linux 9.0 (Plow) on /dev/loop2p3
Adding boot menu entry for UEFI Firmware Settings ...
done
Unregistering from: subscription.rhsm.redhat.com:443/subscription
System has been unregistered.
All local data removed
mv: cannot stat '/etc/resolv.conf.orig': No such file or directory
I0523 10:56:07.496652  114183 qcow2ova.go:271] Preparation completed
I0523 10:56:07.496702  114183 qcow2ova.go:273] Creating an OVA bundle
I0523 10:56:13.948613  114183 qcow2ova.go:278] OVA bundle creation completed: /tmp/qcow2ova856919849/testrhel94.ova
I0523 10:56:13.948648  114183 qcow2ova.go:280] Compressing an OVA file
I0523 10:56:34.566875  114183 qcow2ova.go:286] OVA file Compression completed

Successfully converted Qcow2 image to OVA format, find at /root/pvsadm/bin/testrhel94.ova.gz
OS root password: McLCOTaImgX6kj0I

@janagoudarniroop could you retry this with latest version.

mkumatag commented 3 months ago

closing this bug as no reply from the author, will reopen this bug if required.