Created
March 30, 2017 12:40
-
-
Save johannesostling/9c6dcf15b710798600061a945edf5f1b to your computer and use it in GitHub Desktop.
Vagrant extend disk image
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
pvcreate /dev/sdb | |
vgextend VolGroup00 /dev/sdb | |
lvextend -l +100%FREE /dev/VolGroup00/LogVol00 | |
xfs_growfs /dev/VolGroup00/LogVol00 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure("2") do |config| | |
config.vm.box = "centos/7" | |
config.vm.provider "virtualbox" do |v| | |
if !File.exist?("disk/extradisk.vdi") | |
#TODO: check if controler exist already | |
v.customize [ | |
'storagectl', :id, | |
"--name", "satacontroller", | |
"--add", "sata", | |
"--controller", "IntelAhci", | |
"--portcount", "1", | |
"--hostiocache", "off" | |
] | |
v.customize [ | |
'createhd', | |
'--filename', 'disk/extradisk.vdi', | |
'--format', 'VDI', | |
'--size', 120400 | |
] | |
v.customize [ | |
'storageattach', :id, | |
'--storagectl', "satacontroller", | |
'--port', 1, '--device', 0, | |
'--type', 'hdd', '--medium', 'disk/extradisk.vdi' | |
] | |
end | |
end | |
config.vm.provision "shell", path: "provisionextend.sh" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment