Skip to content
Snippets Groups Projects
Commit 56e2fd27 authored by Benoit Donneaux's avatar Benoit Donneaux
Browse files

Tune some QEmu settings

parent 7ba2040d
No related branches found
No related tags found
2 merge requests!396Support QEmu local grid,!384update production
......@@ -17,6 +17,12 @@ Use the local development environment
# Save bytes and build time, optional but recommended:
virtualisation.virtualbox.host.headless = true;
# Create a local pool for libvirt
mkdir -p ~/.libvirt/images
sudo virsh pool-define-as morph_local --type dir --target ${HOME}/.libvirt/images
virsh pool-autostart morph_local
virsh pool-start morph_local
1. Enter the morph local grid directory::
cd morph/grid/local
......@@ -27,7 +33,8 @@ Use the local development environment
3. Build and start the VMs::
VAGRANT_DEFAULT_PROVIDER=virtualbox vagrant up
export VAGRANT_DEFAULT_PROVIDER=virtualbox # Use `libvirt` for QEmu
vagrant up # Add `--no-parallel` on low resources
4. Then, add the Vagrant SSH configuration to your user's ``~/.ssh/config`` file::
......@@ -45,7 +52,7 @@ Use the local development environment
morph push grid.nix
morph deploy grid.nix boot
vagrant halt
vagrant up
vagrant up --no-destroy-on-error # Add `--no-parallel` on low resources
morph upload-secrets grid.nix
You should now be able to log in with the users and keys you set in your ``users.nix`` file.
......@@ -8,11 +8,28 @@ Vagrant.configure("2") do |config|
# For a complete reference, please see the online documentation at
# https://docs.vagrantup.com.
# We do not need to sync the working dir. with our guests
config.vm.synced_folder ".", "/vagrant", disabled: true
# Tune QEmu guests
config.vm.provider :libvirt do |libvirt|
# Using a specific pool may help to manage the disk space
libvirt.storage_pool_name = "morph_local"
libvirt.snapshot_pool_name = "morph_local"
# No need of graphics
libvirt.graphics_type = "none"
libvirt.video_type = "none"
end
config.vm.define "payments.localdev" do |config|
config.vm.hostname = "payments"
config.vm.box = "esselius/nixos"
config.vm.box_version = "20.09"
config.vm.box_check_update = false
config.vm.provider :libvirt do |domain|
domain.cpus = 2
domain.memory = 1024
end
# To use the self-updating deployment system you need more memory. Giving
# all of the VMs enough memory for this is rather taxing, though, and the
......@@ -40,6 +57,10 @@ Vagrant.configure("2") do |config|
config.vm.box = "esselius/nixos"
config.vm.box_version = "20.09"
config.vm.box_check_update = false
config.vm.provider :libvirt do |domain|
domain.cpus = 2
domain.memory = 1024
end
config.vm.network "private_network", ip: "192.168.56.22"
end
......@@ -48,6 +69,10 @@ Vagrant.configure("2") do |config|
config.vm.box = "esselius/nixos"
config.vm.box_version = "20.09"
config.vm.box_check_update = false
config.vm.provider :libvirt do |domain|
domain.cpus = 2
domain.memory = 1024
end
config.vm.network "private_network", ip: "192.168.56.23"
end
......@@ -56,12 +81,17 @@ Vagrant.configure("2") do |config|
config.vm.box = "esselius/nixos"
config.vm.box_version = "20.09"
config.vm.box_check_update = false
config.vm.provider :libvirt do |domain|
domain.cpus = 2
domain.memory = 1024
end
config.vm.network "private_network", ip: "192.168.56.24"
end
# To make the VMs assign the static IPs to the network interfaces we need a rebuild:
config.vm.provision "shell", inline: "echo '{nix.trustedUsers = [ \"@wheel\" \"root\" \"vagrant\" ];}' > /etc/nixos/custom-configuration.nix"
config.vm.provision "shell", inline: "nixos-rebuild switch"
config.vm.provision "shell", inline: "systemctl stop firewall.service"
config.trigger.after :up do |trigger|
trigger.info = "Hostname and IP address this host actually uses:"
......
......@@ -17,7 +17,7 @@
config = {
virtualisation.virtualbox.guest.enable = true;
boot.loader.grub.device = "/dev/sda";
boot.loader.grub.device = "/dev/vda";
boot.initrd.availableKernelModules = [ "ata_piix" "sd_mod" "sr_mod" ];
boot.kernel.sysctl = { "vm.swappiness" = 0; };
......@@ -47,7 +47,7 @@
fileSystems."/storage" = { fsType = "tmpfs"; };
fileSystems."/" =
{ device = "/dev/sda1";
{ device = "/dev/vda1";
fsType = "ext4";
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment