Bug 2032524
| Summary: | [RHEL9] [Azure] cloud-init fails to configure the system | |||
|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 9 | Reporter: | Neal Gompa <ngompa13> | |
| Component: | cloud-init | Assignee: | Emanuele Giuseppe Esposito <eesposit> | |
| Status: | CLOSED ERRATA | QA Contact: | Huijuan Zhao <huzhao> | |
| Severity: | high | Docs Contact: | ||
| Priority: | unspecified | |||
| Version: | CentOS Stream | CC: | adimania, apevec, atodorov, bstinson, carl, davide, davidmccheyne, daxelrod, dustymabe, eesposit, eterrell, extras-qa, fedora, francois.rigault, gholms, huzhao, jgreguske, jwboyer, lars, ldu, matt, mhayden, michel, mrezanin, ngompa13, shardy, s, xiachen, xiliang, yacao, yuxisun | |
| Target Milestone: | rc | Keywords: | Triaged | |
| Target Release: | --- | Flags: | pm-rhel:
mirror+
|
|
| Hardware: | Unspecified | |||
| OS: | Unspecified | |||
| Whiteboard: | ||||
| Fixed In Version: | cloud-init-21.1-15.el9 | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | ||
| Clone Of: | 1974262 | |||
| : | 2039697 (view as bug list) | Environment: | ||
| Last Closed: | 2022-05-17 12:26:18 UTC | Type: | Bug | |
| Regression: | --- | Mount Type: | --- | |
| Documentation: | --- | CRM: | ||
| Verified Versions: | Category: | --- | ||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | ||
| Cloudforms Team: | --- | Target Upstream Version: | ||
| Embargoed: | ||||
| Bug Depends On: | ||||
| Bug Blocks: | 2039697 | |||
|
Description
Neal Gompa
2021-12-14 16:05:07 UTC
Tried it with RHEL-9(cloud-init-21.1-14.el9) on Azure, did not meet this issue as we pre-installed openssl and gdisk in the image.
Tried to remove openssl and gdisk from RHEL-9, failed to remove openssl as it is dependency for several other packages, and it is included in rhel-guest-image by default. So maybe no need adding openssl as cloud-init dependency.
But after removed gdisk, there is error when do partitioning operation which should be called by cloud-utils-growpart:
$ cat /var/log/cloud-init.log
---------------------------------
673 2021-12-15 02:05:09,765 - util.py[WARNING]: Failed partitioning operation
674 Error running partition command on /dev/sda
675 'NoneType' object has no attribute 'encode'
676 2021-12-15 02:05:09,773 - util.py[DEBUG]: Failed partitioning operation
677 Error running partition command on /dev/sda
678 'NoneType' object has no attribute 'encode'
679 Traceback (most recent call last):
680 File "/usr/lib/python3.9/site-packages/cloudinit/config/cc_disk_setup.py", line 491, in check_partition_gpt_layout
681 out, _err = subp.subp(prt_cmd, update_env=LANG_C_ENV)
682 File "/usr/lib/python3.9/site-packages/cloudinit/subp.py", line 253, in subp
683 bytes_args = [
684 File "/usr/lib/python3.9/site-packages/cloudinit/subp.py", line 254, in <listcomp>
685 x if isinstance(x, bytes) else x.encode("utf-8")
686 AttributeError: 'NoneType' object has no attribute 'encode'
687
688 The above exception was the direct cause of the following exception:
689
690 Traceback (most recent call last):
691 File "/usr/lib/python3.9/site-packages/cloudinit/config/cc_disk_setup.py", line 139, in handle
692 util.log_time(logfunc=LOG.debug,
693 File "/usr/lib/python3.9/site-packages/cloudinit/util.py", line 2409, in log_time
694 ret = func(*args, **kwargs)
695 File "/usr/lib/python3.9/site-packages/cloudinit/config/cc_disk_setup.py", line 808, in mkpart
696 if check_partition_layout(table_type, device, layout):
697 File "/usr/lib/python3.9/site-packages/cloudinit/config/cc_disk_setup.py", line 537, in check_partition_layout
698 found_layout = get_dyn_func(
699 File "/usr/lib/python3.9/site-packages/cloudinit/config/cc_disk_setup.py", line 431, in get_dyn_func
700 return globals()[func_name](*func_args)
701 File "/usr/lib/python3.9/site-packages/cloudinit/config/cc_disk_setup.py", line 493, in check_partition_gpt_layout
702 raise Exception(
703 Exception: Error running partition command on /dev/sda
704 'NoneType' object has no attribute 'encode'
---------------------------------
Neal, did you use Fedora-Cloud-Base-35-1.2.x86_64.qcow2 to meet the issue? Is it Fedora image which does not have openssl and gdisk pre-installed by default?
According to the tests in RHEL-9 on Azure, IMO maybe we can add gdisk as cloud-utils-growpart dependency in RHEL. Please correct me if anything wrong. Thanks!
(In reply to Huijuan Zhao from comment #2) > Tried it with RHEL-9(cloud-init-21.1-14.el9) on Azure, did not meet this > issue as we pre-installed openssl and gdisk in the image. > > Tried to remove openssl and gdisk from RHEL-9, failed to remove openssl as > it is dependency for several other packages, and it is included in > rhel-guest-image by default. So maybe no need adding openssl as cloud-init > dependency. > > But after removed gdisk, there is error when do partitioning operation which > should be called by cloud-utils-growpart: > $ cat /var/log/cloud-init.log > --------------------------------- > 673 2021-12-15 02:05:09,765 - util.py[WARNING]: Failed partitioning > operation > 674 Error running partition command on /dev/sda > 675 'NoneType' object has no attribute 'encode' > 676 2021-12-15 02:05:09,773 - util.py[DEBUG]: Failed partitioning > operation > 677 Error running partition command on /dev/sda > 678 'NoneType' object has no attribute 'encode' > 679 Traceback (most recent call last): > 680 File > "/usr/lib/python3.9/site-packages/cloudinit/config/cc_disk_setup.py", line > 491, in check_partition_gpt_layout > 681 out, _err = subp.subp(prt_cmd, update_env=LANG_C_ENV) > 682 File "/usr/lib/python3.9/site-packages/cloudinit/subp.py", line > 253, in subp > 683 bytes_args = [ > 684 File "/usr/lib/python3.9/site-packages/cloudinit/subp.py", line > 254, in <listcomp> > 685 x if isinstance(x, bytes) else x.encode("utf-8") > 686 AttributeError: 'NoneType' object has no attribute 'encode' > 687 > 688 The above exception was the direct cause of the following exception: > 689 > 690 Traceback (most recent call last): > 691 File > "/usr/lib/python3.9/site-packages/cloudinit/config/cc_disk_setup.py", line > 139, in handle > 692 util.log_time(logfunc=LOG.debug, > 693 File "/usr/lib/python3.9/site-packages/cloudinit/util.py", line > 2409, in log_time > 694 ret = func(*args, **kwargs) > 695 File > "/usr/lib/python3.9/site-packages/cloudinit/config/cc_disk_setup.py", line > 808, in mkpart > 696 if check_partition_layout(table_type, device, layout): > 697 File > "/usr/lib/python3.9/site-packages/cloudinit/config/cc_disk_setup.py", line > 537, in check_partition_layout > 698 found_layout = get_dyn_func( > 699 File > "/usr/lib/python3.9/site-packages/cloudinit/config/cc_disk_setup.py", line > 431, in get_dyn_func > 700 return globals()[func_name](*func_args) > 701 File > "/usr/lib/python3.9/site-packages/cloudinit/config/cc_disk_setup.py", line > 493, in check_partition_gpt_layout > 702 raise Exception( > 703 Exception: Error running partition command on /dev/sda > 704 'NoneType' object has no attribute 'encode' > --------------------------------- > > > Neal, did you use Fedora-Cloud-Base-35-1.2.x86_64.qcow2 to meet the issue? > Is it Fedora image which does not have openssl and gdisk pre-installed by > default? > That is the case, yes. I also tested with a custom CentOS Stream 9 image that I built, where it's possible to not have the openssl CLI tools installed. As we need openssl and gdisk at the cloud-init level, it makes sense to guarantee it is always there for this stuff. > According to the tests in RHEL-9 on Azure, IMO maybe we can add gdisk as > cloud-utils-growpart dependency in RHEL. Please correct me if anything > wrong. Thanks! I think the dependency needs to be at the cloud-init level because sgdisk gets run by cloud-init stuff before passing it to cloud-utils-growpart. If cloud-utils-growpart *also* calls sgdisk, then it needs a gdisk dependency too, but cloud-init *definitely* needs the gdisk dependency. Neal, thanks for the explanation and updates. It is ok to add openssl and gdisk as dependency at the cloud-init level from QE side, thanks! Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (new packages: cloud-init), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2022:2308 |