Skip to content

Commit

Permalink
Implement fake cinder LVMs on AIO
Browse files Browse the repository at this point in the history
  • Loading branch information
electrocucaracha committed May 29, 2024
1 parent 12c6ed6 commit 0a62a1f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
4 changes: 4 additions & 0 deletions node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,12 @@ if [ -n "${cinder_volumes-}" ]; then
fi
# Ensure that the volume is empty
sudo dd if=/dev/zero of="$cinder_volumes" bs=512 count=1

# Creation of cinder LVM
sudo pvcreate "$cinder_volumes"
sudo vgcreate cinder-volumes "$cinder_volumes"
sudo pvdisplay

sudo modprobe dm_thin_pool
echo "dm_thin_pool" | sudo tee /etc/modules-load.d/dm_thin_pool.conf
sudo modprobe target_core_mod
Expand Down
16 changes: 8 additions & 8 deletions samples/aio/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,13 @@ Vagrant.configure("2") do |config|
sudo chmod +x /etc/rc.d/rc.local
SHELL

# Configure fake cinder LVM
config.vm.provision "shell", privileged: false, inline: <<~SHELL
dd if=/dev/zero of=~/cinder.img bs=1 count=1 seek=100G
sudo losetup $(sudo losetup -f) ~/cinder.img
sudo losetup -l
SHELL

# Ensure Permissive SELinux policy
config.vm.provision "shell", privileged: false, inline: <<-SHELL
if command -v sestatus; then
Expand Down Expand Up @@ -128,7 +135,7 @@ Vagrant.configure("2") do |config|
cd /vagrant
echo "127.0.0.1 localhost" | sudo tee /etc/hosts
./node.sh -v sdb=/var/lib/docker/ -c /dev/sdc | tee ~/node_aio.log
./node.sh -v sdb=/var/lib/docker/ -c "$(sudo losetup -l | grep cinder.img | awk '{ print $1 }')" | tee ~/node_aio.log
./install.sh
grep --no-filename ": .* secs" ~/*.log
Expand Down Expand Up @@ -165,7 +172,6 @@ Vagrant.configure("2") do |config|
v.customize ["modifyvm", :id, "--vtxvpid", "on"]
end
config.vm.disk :disk, name: "docker", size: "50GB"
config.vm.disk :disk, name: "cinder", size: "100GB"

config.vm.provider :libvirt do |v, override|
override.vm.synced_folder "../../", "/vagrant", type: "virtiofs"
Expand Down Expand Up @@ -196,12 +202,6 @@ Vagrant.configure("2") do |config|
disk_name: "docker",
disk_type: "pd-standard",
autodelete_disk: true
},
{
disk_size: 100,
disk_name: "cinder",
disk_type: "pd-standard",
autodelete_disk: true
}
]

Expand Down

0 comments on commit 0a62a1f

Please sign in to comment.