Skip to content
This repository has been archived by the owner on Dec 13, 2019. It is now read-only.

Build first revision on September 24 #1

Closed
4 tasks done
geerlingguy opened this issue Sep 20, 2019 · 30 comments
Closed
4 tasks done

Build first revision on September 24 #1

geerlingguy opened this issue Sep 20, 2019 · 30 comments

Comments

@geerlingguy
Copy link
Owner

geerlingguy commented Sep 20, 2019

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

  • Update centos8.json to have the proper ISO and SHA-256 values.
  • Build the VM locally, and test it using the included Vagrantfile.
  • Push a 1.0.0 version up to Vagrant Cloud.
  • Fix ansible uninstall in image build.
@geerlingguy
Copy link
Owner Author

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

Testing a local build here at #AnsibleFest

@caffeinejolt
Copy link

Can't wait!

@geerlingguy
Copy link
Owner Author

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

@geerlingguy
Copy link
Owner Author

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...

@geerlingguy
Copy link
Owner Author

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
Copy link
Owner Author

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
Copy link
Owner Author

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
Copy link
Owner Author

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

@geerlingguy
Copy link
Owner Author

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

@geerlingguy
Copy link
Owner Author

geerlingguy commented Sep 25, 2019

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
Copy link
Owner Author

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

@geerlingguy
Copy link
Owner Author

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

@geerlingguy
Copy link
Owner Author

geerlingguy commented Sep 25, 2019

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

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
Copy link
Owner Author

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

@geerlingguy
Copy link
Owner Author

Upstream issue: geerlingguy/ansible-role-packer_rhel#20

@geerlingguy
Copy link
Owner Author

@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
Copy link
Owner Author

Fixed upstream issues, trying a new build again.

@ronjarrell
Copy link

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
Copy link
Owner Author

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
Copy link
Owner Author

Now having trouble with pip3-based ansible uninstallation with pip-autoremove, so trying a trick I found in invl/pip-autoremove#18 (comment)

@geerlingguy
Copy link
Owner Author

@geerlingguy
Copy link
Owner Author

Still need to fix uninstall of Ansible.

@TimRots
Copy link

TimRots commented Sep 26, 2019

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
Copy link
Owner Author

@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
Copy link
Owner Author

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

TimRots commented Sep 27, 2019

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

ndobbs commented Oct 7, 2019

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

vamfoom commented Oct 30, 2019

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

  • Installation source (Error setting up software source)
  • Software selection (Error checking software selection)

@ronjarrell
Copy link

@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"
]
]
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants