I use packer to build a qcow2 image for Openstack - recently I noticed that when instances boot cloud-init is no longer able to set the hostname via hostnamectl. This is also true when I run this manually as root:
Code: Select all
# hostnamectl set-hostname test.local
Could not set property: Access denied
Code: Select all
== BEGIN uname -rmi ==
3.10.0-693.17.1.el7.x86_64 x86_64 x86_64
== END uname -rmi ==
== BEGIN rpm -qa \*-release\* ==
epel-release-7-9.noarch
nodesource-release-el7-1.noarch
centos-release-7-4.1708.el7.centos.x86_64
== END rpm -qa \*-release\* ==
== BEGIN cat /etc/redhat-release ==
CentOS Linux release 7.4.1708 (Core)
== END cat /etc/redhat-release ==
== BEGIN getenforce ==
Disabled
== END getenforce ==
== BEGIN free -m ==
total used free shared buff/cache available
Mem: 3790 147 1111 16 2532 3370
Swap: 0 0 0
== END free -m ==
So I turned my attention to the build process to see at what point in the process this breaks.
I start with the minimal cloud image from http://cloud.centos.org/centos/7/images ... loud.qcow2 which at the time of posting is 7.4 1708.
I then run
Code: Select all
yum -y update
Code: Select all
setenforce 0
My packer script then goes on installing and customising the image to my needs.
I have littered this script with calls to
Code: Select all
hostnamectl set-hostname test.local
This has shown that it is after installing perl-core with
Code: Select all
yum -y install perl-core
The perl install seems to be fine, and all pulled in from the base repo:
Code: Select all
openstack: Installing:
openstack: perl-core x86_64 5.16.3-292.el7 base 42 k
openstack: Installing for dependencies:
openstack: perl-Archive-Extract noarch 1:0.68-3.el7 base 28 k
openstack: perl-Archive-Tar noarch 1.92-2.el7 base 73 k
openstack: perl-CPAN-Meta noarch 2.120921-5.el7 base 113 k
openstack: perl-CPAN-Meta-Requirements noarch 2.122-7.el7 base 24 k
openstack: perl-CPAN-Meta-YAML noarch 0.008-14.el7 base 24 k
openstack: perl-CPANPLUS noarch 0.91.38-4.el7 base 307 k
openstack: perl-CPANPLUS-Dist-Build noarch 0.70-3.el7 base 28 k
openstack: perl-DBD-SQLite x86_64 1.39-3.el7 base 1.3 M
openstack: perl-DBI x86_64 1.627-4.el7 base 802 k
openstack: perl-DBIx-Simple noarch 1.35-7.el7 base 43 k
openstack: perl-DB_File x86_64 1.830-6.el7 base 74 k
openstack: perl-ExtUtils-CBuilder noarch 1:0.28.2.6-292.el7 base 67 k
openstack: perl-ExtUtils-Embed noarch 1.30-292.el7 base 50 k
openstack: perl-File-Fetch noarch 0.42-2.el7 base 27 k
openstack: perl-IO-Zlib noarch 1:1.10-292.el7 base 51 k
openstack: perl-IPC-Cmd noarch 1:0.80-4.el7 base 34 k
openstack: perl-JSON-PP noarch 2.27202-2.el7 base 55 k
openstack: perl-Locale-Maketext-Simple noarch 1:0.21-292.el7 base 50 k
openstack: perl-Log-Message noarch 1:0.08-3.el7 base 29 k
openstack: perl-Log-Message-Simple noarch 0.10-2.el7 base 11 k
openstack: perl-Module-Build noarch 2:0.40.05-2.el7 base 281 k
openstack: perl-Module-CoreList noarch 1:2.76.02-292.el7 base 85 k
openstack: perl-Module-Load noarch 1:0.24-3.el7 base 11 k
openstack: perl-Module-Load-Conditional noarch 0.54-3.el7 base 18 k
openstack: perl-Module-Loaded noarch 1:0.08-292.el7 base 46 k
openstack: perl-Module-Metadata noarch 1.000018-2.el7 base 26 k
openstack: perl-Net-Daemon noarch 0.48-5.el7 base 51 k
openstack: perl-Object-Accessor noarch 1:0.42-292.el7 base 55 k
openstack: perl-Package-Constants noarch 1:0.02-292.el7 base 45 k
openstack: perl-Params-Check noarch 1:0.38-2.el7 base 18 k
openstack: perl-Parse-CPAN-Meta noarch 1:1.4404-5.el7 base 14 k
openstack: perl-Perl-OSType noarch 1.003-3.el7 base 20 k
openstack: perl-PlRPC noarch 0.2020-14.el7 base 36 k
openstack: perl-Term-UI noarch 0.36-2.el7 base 22 k
openstack: perl-Thread-Queue noarch 3.02-2.el7 base 17 k
openstack: perl-Time-Piece x86_64 1.20.1-292.el7 base 69 k
openstack: perl-Version-Requirements noarch 0.101022-244.el7 base 21 k
openstack: perl-version x86_64 3:0.99.07-2.el7 base 84 k
I'm going to start cutting out the rest of my install steps and see if there is another dependency that is involved - I'll update if I come to any conclusions!