geerlingguy / packer-centos-8

This build has been moved - see README.md
https://app.vagrantup.com/geerlingguy/boxes/centos8
12 stars 9 forks source link

Build first revision on September 24 #1

Closed geerlingguy closed 5 years ago

geerlingguy commented 5 years ago

CentOS 8 is slated for release on September 24. So on that date:

geerlingguy commented 5 years ago

Looks like it's happening... http://mirrors.mit.edu/centos/8/isos/x86_64/

Testing a local build here at #AnsibleFest

caffeinejolt commented 5 years ago

Can't wait!

geerlingguy commented 5 years ago

Having a little trouble with my kickstart config, so I'll be debugging that as soon as I get some time!

geerlingguy commented 5 years ago

It's starting the installation but it gets to the following screen and fails:

Screen Shot 2019-09-24 at 8 20 32 PM

Specifically with the following two errors:

I hope I don't have to download the massive DVD installation media instead of the boot.iso...

geerlingguy commented 5 years ago

The CentOS 8 downloads page says:

The boot image can be used for doing installs over network. After booting the computer with this image, the installer will ask from where it should fetch the packages to be installed.

But it seems it fails to find things, I have tried both in the graphical installer and via CLI with kickstart and neither way seems to be happy finding an Installation source :/

geerlingguy commented 5 years ago

Looks like the DVD installer is working—at least it's getting farther along than that status check screen! Just took about 4 hours to download on hotel WiFi at AnsibleFest.

geerlingguy commented 5 years ago

Drat, now getting:

Screen Shot 2019-09-24 at 11 00 05 PM
gi.Overrides.BlockDev.SwapError: Failed to activate swap on /dev/mapper/cl-swap: Cannot allocate memory
geerlingguy commented 5 years ago

Hmm... adjusting the memory from 512 to 2048 seems to have fixed that up, it's progressing further.

geerlingguy commented 5 years ago

Ready for upload... still installing locally. https://app.vagrantup.com/geerlingguy/boxes/centos8

geerlingguy commented 5 years ago

Everything worked... but the kickstart config for the vagrant/vagrant user seems to not have worked.

user --name=vagrant --plaintext --password vagrant --groups=vagrant,wheel

So I moved it up above reboot in the ks.cfg file to see if that makes a difference. Packer timed out trying to reach via SSH, and I could only log in in the UI using the root user account.

==> virtualbox-iso: Waiting for SSH to become available...
==> virtualbox-iso: Error waiting for SSH: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none password], no supported methods remain
==> virtualbox-iso: Deregistering and deleting VM...
==> virtualbox-iso: Deleting output directory...
Build 'virtualbox-iso' errored: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none password], no supported methods remain

==> Some builds didn't complete successfully and had errors:
--> virtualbox-iso: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none password], no supported methods remain

==> Builds finished but no artifacts were created.
geerlingguy commented 5 years ago

Trying another build with -on-error=abort to see if I can debug in the VM.

geerlingguy commented 5 years ago

Vagrant user is still not being created. This is very strange.

geerlingguy commented 5 years ago

Even stranger; vagrant group exists, but user doesn't. This is very strange...

When I run useradd vagrant manually, I get:

useradd: group vagrant exists - if you want to add this user to that group, use -g

So I'm going to force it a little more... and drop the top-level user option.

%post
# Add vagrant user (user directive isn't working for some reason).
useradd vagrant
echo "vagrant" | passwd vagrant --stdin
usermod -a -G wheel vagrant
%end

Also, on Twitter, @b00gamonkey mentioned the tool ksvalidator which may find something... https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/performing_an_advanced_rhel_installation/maintaining-kickstart-files_installing-rhel-as-an-experienced-user#verifying-a-kickstart-file_maintaining-kickstart-files

ronjarrell commented 5 years ago

I was trying to use your packer file to build centos8 under the qemu builder (thanks for being so on the ball that it was available day 1!), but it keeps complaining that "unsupported_hardware" isn't a valid command in the kickstart file. I'm using the CentOS-8-x86_64-1905.iso file. Haven't had a chance to just remove them yet.

geerlingguy commented 5 years ago

That worked! (adding user in %post). Hopefully the packer-rhel role works as is... otherwise I'll file upstream issues.

geerlingguy commented 5 years ago

Upstream issue: https://github.com/geerlingguy/ansible-role-packer-rhel/issues/20

geerlingguy commented 5 years ago

@ronjarrell - I'm still working on getting the ks.cfg file updated—but please see the branch (not master) for this issue for the latest work as of right now.

geerlingguy commented 5 years ago

Fixed upstream issues, trying a new build again.

ronjarrell commented 5 years ago

Working from your ks file I got an image to build, although amazon won't import it because their importer apparently doesn't recognize the kernel. --excludedocs was kicked out. But I don't think the %post is running, I'm seeing this:

Verifying rsyslog.x86_64 (366/368)
Verifying unbound-libs.x86_64 (367/368)
Verifying xkeyboard-config.noarch (368/368)
.
Configuring storage
[terminated]

Followed by a big blank space, then


[  OK  ] Deactivated swap /dev/zram0.
[  OK  ] Stopped Service enabling compressing RAM with zRam.
[  OK  ] Stopped System Logging Service.
[  OK  ] Stopped target Network is Online.

All the shutdown dialog. I think it installer is dieing.

I'm using the boot image, but doing a URL= to a personal copy of the repo, to the centos/8/BaseOS/x86_64/os branch.

geerlingguy commented 5 years ago

I was unable to have any luck with the boot image; I had to switch to the DVD image to get it to work. Not sure if it's a problem on my end or the iso.

geerlingguy commented 5 years ago

Now having trouble with pip3-based ansible uninstallation with pip-autoremove, so trying a trick I found in https://github.com/invl/pip-autoremove/issues/18#issuecomment-441425582

geerlingguy commented 5 years ago

First revision: https://app.vagrantup.com/geerlingguy/boxes/centos8/versions/1.0.0

geerlingguy commented 5 years ago

Still need to fix uninstall of Ansible.

TimRots commented 5 years ago

It's starting the installation but it gets to the following screen and fails:

Screen Shot 2019-09-24 at 8 20 32 PM

Specifically with the following two errors:

* Installation source (Error setting up software source)

* Software selection (Error checking software selection)

I hope I don't have to download the massive DVD installation media instead of the boot.iso...

You don't have to download the DVD. You can substitute the cdrom command your kickstart file with "url --url https://mirror.ams1.nl.leaseweb.net/centos/8.0.1905/BaseOS/x86_64/os/" and anaconda then knows which mirror to use.

geerlingguy commented 5 years ago

@TimRots I'd rather avoid having to specify a URL manually.

Also, when I was in the CLI, I tried entering a manual URL, and the status changed to Processing... then after a while it went back to "Error" again. I tried with about 5 different mirrors :/

geerlingguy commented 5 years ago

@TimRots since I have a working image now, I opened follow-up issue #3 to try to figure out that issue. I've merged the current working code up to master.

TimRots commented 5 years ago

@geerlingguy I agree that the url command is not the most ideal solution fo the case on hand, as the mirror is region specific, but downloading the DVD has more overhead imho.

The installation of the OS finishes well for me, but during one of the last steps packer fails on one of the scripts. Will make a pull request in #3 after debugging the last issue with -on-error=abort

Ps, Thank you for your efforts (:

ndobbs commented 5 years ago

Even stranger; vagrant group exists, but user doesn't. This is very strange...

When I run useradd vagrant manually, I get:

useradd: group vagrant exists - if you want to add this user to that group, use -g

So I'm going to force it a little more... and drop the top-level user option.

%post
# Add vagrant user (user directive isn't working for some reason).
useradd vagrant
echo "vagrant" | passwd vagrant --stdin
usermod -a -G wheel vagrant
%end

Also, on Twitter, @b00gamonkey mentioned the tool ksvalidator which may find something... https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/performing_an_advanced_rhel_installation/maintaining-kickstart-files_installing-rhel-as-an-experienced-user#verifying-a-kickstart-file_maintaining-kickstart-files

@geerlingguy thanks for writing this up. I've run into this as well building my own boxes.

I've submitted an issue on the CentOS bug tracker here: https://bugs.centos.org/view.php?id=16550

vamfoom commented 5 years ago

Did this work for you under QEMU? I tried both the boot and dvd ISOs, but can't get past these errors:

ronjarrell commented 5 years ago

@vamfoom This is the qemu building config I used to successfully build a centos8 image:

{ "type": "qemu", "boot_key_interval": "10ms", "iso_url": "http://path-to-our-internal-mirror/centos/8/isos/x86_64/CentOS-8-x86_64-1905-boot.iso", "iso_checksum": "a7993a0d4b7fef2433e0d4f53530b63c715d3aadbe91f152ee5c3621139a2cbc", "iso_checksum_type": "sha256", "output_directory": "output_centos_tdhtest", "communicator": "none", "shutdown_command": "", "shutdown_timeout": "20m", "disk_size": 3000, "format": "raw", "accelerator": "hvf", "http_directory": "http", "vm_name": "disk.raw", "net_device": "virtio-net", "disk_interface": "virtio", "boot_wait": "1s", "headless": true, "skip_compaction": true, "boot_command": [ " console=ttyS0,115200n8 nomodeset text ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/centos8.ks" ], "qemu_binary": "/usr/local/bin/qemu-system-x86_64", "qemuargs": [ [ "-chardev", "file,id=pts,path=serial.log" ], [ "-device", "isa-serial,chardev=pts" ], [ "-m", "2G" ], [ "-cpu", "host" ] ] }