Upgrade Vagrant VM to CentOS 8

This commit upgrades the development Vagrant vm to use
CentOS 8.

This also increases the size of the root disk as the
CentOS 8 cloud image is only 10GB which is not
sufficient for a Kayobe deployment.

Change-Id: I614cf6e0a774229da30831e806e2ae125e5cf0fb
This commit is contained in:
Scott Solkhon 2020-05-18 22:23:07 +01:00
parent fc017249c2
commit 4e70fbcec6
2 changed files with 22 additions and 8 deletions

20
Vagrantfile vendored
View File

@ -6,8 +6,11 @@ Vagrant.configure('2') do |config|
config.vm.network 'private_network', ip: '192.168.33.3', auto_config: false
config.vm.box = 'stackhpc/centos-7'
config.vm.box_version = '0.2.0'
config.vm.box = 'centos/8'
# The default CentOS box comes with a root disk that is too small to fit a
# deployment on so we need to make it bigger.
config.disksize.size = '20GB'
config.vm.provider 'virtualbox' do |vb|
vb.memory = '4096'
@ -21,6 +24,18 @@ Vagrant.configure('2') do |config|
end
config.vm.provision 'shell', inline: <<-SHELL
# Extend the root disk
sudo parted "/dev/sda" ---pretend-input-tty <<EOF
resizepart
1
100%
Yes
-0
quit
EOF
sudo xfs_growfs -d /
echo "cat > /etc/selinux/config << EOF
SELINUX=disabled
SELINUXTYPE=targeted
@ -40,7 +55,6 @@ BOOTPROTO=none
IPADDR=192.168.33.3
NETMASK=255.255.255.0
ONBOOT=yes
NM_CONTROLLED=no
EOF
sudo ifup eth1

View File

@ -5,23 +5,23 @@ Vagrant
=======
Kayobe provides a Vagrantfile that can be used to bring up a virtual machine
for use as a development environment. The VM is based on the `stackhpc/centos-7
<https://app.vagrantup.com/stackhpc/boxes/centos-7>`_ CentOS 7 image, and
for use as a development environment. The VM is based on the `centos/8
<https://app.vagrantup.com/centos/boxes/8>`_ CentOS 8 image, and
supports the following providers:
* VirtualBox
* VMWare Fusion
The VM is configured with 4GB RAM. It has a single private network in addition
The VM is configured with 4GB RAM and a 20GB HDD. It has a single private network in addition
to the standard Vagrant NAT network.
Preparation
===========
First, ensure that Vagrant is installed and correctly configured to use
the required provider. Also install the following vagrant plugin::
the required provider. Also install the following vagrant plugins::
vagrant plugin install vagrant-reload
vagrant plugin install vagrant-reload vagrant-disksize
If using the VirtualBox provider, install the following vagrant plugin::