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

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 opened this issue May 14, 2024 · 4 comments
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@janagoudarniroop
Copy link

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
@janagoudarniroop janagoudarniroop added the kind/bug Categorizes issue or PR as related to a bug. label May 14, 2024
@mkumatag
Copy link
Member

cc @sudeeshjohn

@mkumatag
Copy link
Member

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

@KeerthanaAP
Copy link
Contributor

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
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

3 participants