Closed mrc0mmand closed 2 years ago
What platform host/hypervisor are you using? I wonder if the virtual disk type is changing between when the box is built, and when you run it. Possibly from virtio-scsi to virtio.
I'm going to see if I can run genfstab inside the chroot shell, and if that generates an fstab using the UUID instead.
What platform host/hypervisor are you using? I wonder if the virtual disk type is changing between when the box is built, and when you run it. Possibly from virtio-scsi to virtio.
Ah, apparently I forgot to include the most important info, my apologies. All my runs are using vagrant-libvirt
on either Fedora 36 or CentOS Stream 8, using the default storage driver (which appears to be virtio
):
I'm going to see if I can run genfstab inside the chroot shell, and if that generates an fstab using the UUID instead.
I just tested the install logic, and it appears that genfstab
is using UUIDs for the root and the swap partitions. I couldn't run genfstab from inside the chroot environment, but I did notice that a systemd unit was create for automatic fstab creation. It makes me wonder if the fstab that is being cretaed when the box is built, is being overwritten.
I also checked, and we're using virtio-scsi
when building the box, but that gets set the storage driver is set to virtio
by default, using the bundled Vagrantfile, since the virtio-scsi
device type is a Red Hat specific thing.
Since you're on RH based distros, you could probably set disk_bus = "virtio-scsi"
... which would probably result in the disk being mapped to the sda
node instead of the vda
node. But that's cheating...
I tried running the arch box on a CentOS 7 sysstem, and everything appears to be good, although this was with the latest v4.1.0 box release.
# ./connect.sh generic arch libvirt
==> box: Loading metadata for box 'generic/arch'
box: URL: https://vagrantcloud.com/generic/arch
==> box: Adding box 'generic/arch' (v4.1.0) for provider: libvirt
box: Downloading: https://vagrantcloud.com/generic/boxes/arch/versions/4.1.0/providers/libvirt.box
box: Calculating and comparing box checksum...
==> box: Successfully added box 'generic/arch' (v4.1.0) for 'libvirt'!
Bringing machine 'default' up with 'libvirt' provider...
==> default: Checking if box 'generic/arch' version '4.1.0' is up to date...
==> default: Uploading base box image as volume into Libvirt storage...
==> default: Creating image (snapshot of base box volume).
==> default: Creating domain with the following settings...
==> default: -- Name: generic-arch-libvirt_default
==> default: -- Description: Source: /home/ladar/robox/check/generic-arch-libvirt/Vagrantfile
==> default: -- Domain type: kvm
==> default: -- Cpus: 2
==> default: -- Feature: acpi
==> default: -- Feature: apic
==> default: -- Feature: pae
==> default: -- Clock offset: utc
==> default: -- Memory: 2048M
==> default: -- Management MAC:
==> default: -- Loader:
==> default: -- Nvram:
==> default: -- Base box: generic/arch
==> default: -- Storage pool: default
==> default: -- Image(vda): /var/lib/libvirt/images/generic-arch-libvirt_default.img, virtio, 128G
==> default: -- Disk driver opts: cache='default'
==> default: -- Kernel:
==> default: -- Initrd:
==> default: -- Graphics Type: vnc
==> default: -- Graphics Port: -1
==> default: -- Graphics IP: 127.0.0.1
==> default: -- Graphics Password: Not defined
==> default: -- Video Type: cirrus
==> default: -- Video VRAM: 256
==> default: -- Video 3D accel: false
==> default: -- Sound Type:
==> default: -- Keymap: en-us
==> default: -- TPM Backend: passthrough
==> default: -- TPM Path:
==> default: -- INPUT: type=mouse, bus=ps2
==> default: -- CHANNEL: type=unix, mode=
==> default: -- CHANNEL: target_type=virtio, target_name=com.qemu.guest_agent.0
==> default: Creating shared folders metadata...
==> default: Starting domain.
==> default: Waiting for domain to get an IP address...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 192.168.121.139:22
default: SSH username: vagrant
default: SSH auth method: private key
default:
default: Vagrant insecure key detected. Vagrant will automatically replace
default: this with a newly generated keypair for better security.
default:
default: Inserting generated public key within guest...
default: Removing insecure key from the guest if it's present...
default: Key inserted! Disconnecting and reconnecting using new SSH key...
==> default: Machine booted and ready!
[vagrant@arch ~]$ cat /etc/fstab
# Static information about the filesystems.
# See fstab(5) for details.
# <file system> <dir> <type> <options> <dump> <pass>
# /dev/sda2
UUID=c7b5eda0-d558-46d1-814f-2091ec78092b / ext4 rw,relatime 0 1
# /dev/sda1
UUID=2d9ecb93-4730-429b-978a-3e6aa33915ad none swap defaults 0 0
#VAGRANT-BEGIN
# The contents below are automatically generated by Vagrant. Do not modify.
#VAGRANT-END
[vagrant@arch ~]$ swapon -v
NAME TYPE SIZE USED PRIO
/dev/vda1 partition 4G 0B -2
I tried running the arch box on a CentOS 7 sysstem, and everything appears to be good, although this was with the latest v4.1.0 box release.
Interesting, with v4.1.0 I can confirm everything looks as it should:
$ vagrant up
Bringing machine 'default' up with 'libvirt' provider...
==> default: Checking if box 'generic/arch' version '4.1.0' is up to date...
==> default: Uploading base box image as volume into Libvirt storage...
==> default: Creating image (snapshot of base box volume).
==> default: Creating domain with the following settings...
==> default: -- Name: arch_default
==> default: -- Description: Source: /home/mrc0mmand/vagrant/arch/Vagrantfile
==> default: -- Domain type: kvm
==> default: -- Cpus: 2
==> default: -- Feature: acpi
==> default: -- Feature: apic
==> default: -- Feature: pae
==> default: -- Clock offset: utc
==> default: -- Memory: 2048M
==> default: -- Management MAC:
==> default: -- Loader:
==> default: -- Nvram:
==> default: -- Base box: generic/arch
==> default: -- Storage pool: default
==> default: -- Image(): /home/mrc0mmand/.local/share/libvirt/images/arch_default.img, 128G
==> default: -- Disk driver opts: cache='default'
==> default: -- Kernel:
==> default: -- Initrd:
==> default: -- Graphics Type: vnc
==> default: -- Graphics Port: -1
==> default: -- Graphics IP: 127.0.0.1
==> default: -- Graphics Password: Not defined
==> default: -- Video Type: cirrus
==> default: -- Video VRAM: 256
==> default: -- Video 3D accel: false
==> default: -- Sound Type:
==> default: -- Keymap: en-us
==> default: -- TPM Backend: passthrough
==> default: -- TPM Path:
==> default: -- Disks: vdb(raw,512M)
==> default: -- Disk(vdb): /home/mrc0mmand/.local/share/libvirt/images/arch_default-vdb.raw
==> default: -- INPUT: type=mouse, bus=ps2
==> default: -- CHANNEL: type=unix, mode=
==> default: -- CHANNEL: target_type=virtio, target_name=com.qemu.guest_agent.0
==> default: -- RNG device model: random
==> default: Creating shared folders metadata...
==> default: Starting domain.
==> default: Waiting for domain to get an IP address...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 192.168.122.120:22
default: SSH username: vagrant
default: SSH auth method: private key
default:
default: Vagrant insecure key detected. Vagrant will automatically replace
default: this with a newly generated keypair for better security.
default:
default: Inserting generated public key within guest...
default: Removing insecure key from the guest if it's present...
default: Key inserted! Disconnecting and reconnecting using new SSH key...
==> default: Machine booted and ready!
$ vagrant ssh
[vagrant@arch ~]$ cat /etc/fstab
# Static information about the filesystems.
# See fstab(5) for details.
# <file system> <dir> <type> <options> <dump> <pass>
# /dev/sda2
UUID=c7b5eda0-d558-46d1-814f-2091ec78092b / ext4 rw,relatime 0 1
# /dev/sda1
UUID=2d9ecb93-4730-429b-978a-3e6aa33915ad none swap defaults 0 0
#VAGRANT-BEGIN
# The contents below are automatically generated by Vagrant. Do not modify.
#VAGRANT-END
[vagrant@arch ~]$
So I guess it was just some transient issue that sorted itself out. In any case, this issue can be safely closed, thanks :-)
There was a recent issue with the mirror list being moved from www.archlinux.org to archlinux.org and the script not accepting the redirect. That was causing problems wiith pacman, but its been fixed. So perhaps that was the culprit.
In the latest generic/arch box (v4.0.4) I noticed that the
/etc/fstab
is incorrectly generated (similarly to #152) - this time only the swap entry is affected, which is not UUID-ified:v4.0.4
v4.0.0
This results in a delayed boot, since systemd waits for
/dev/sda1
to come up, but we're dealing with/dev/vda*
here:Originally I though
genfstab
is at fault, but the version is the same in both boxes, and if I manually mount the swap in the v4.0.4 box, I get the expected result: