francismunch / vmbuilder Goto Github PK
View Code? Open in Web Editor NEWBuild Proxmox VM's from cloud images in just a couple of minutes
Build Proxmox VM's from cloud images in just a couple of minutes
If the process is not finished, ^C
is issued, attempt to clean up (remove the VM and it's resources).
kindofsecure=$(openssl passwd -1 -salt SaltSalt $PASSWORD)
as $PASSWORD is empty
Here is some feature you can add to your script and some who can be updated ! (btw you did a great work! I tred to use Packer but it's less efficiant than this ;) ) :
while true
do
read -r -p "BOOT AT START [Y/n]: " BOOTATSTART
case $BOOTATSTART in
[yY][eE][sS]|[yY])
break
;;
[nN][oO]|[nN])
break
;;
*)
echo "INVALID INPUT, PLEASE ENTER [Y/n]"
;;
esac
done
if [[ "$BOOTATSTART" =~ ^[Yy]$ || "$BOOTATSTART" =~ ^[yY][eE][sS] ]]
then
qm set "$VMID" --onboot 1
else
qm set "$VMID" --onboot 0
fi
while true
do
read -r -p "PROTECT VM [Y/n]: " PROTECTVM
case $PROTECTVM in
[yY][eE][sS]|[yY])
break
;;
[nN][oO]|[nN])
break
;;
*)
echo "INVALID INPUT, PLEASE ENTER [Y/n]"
;;
esac
done
if [[ "$PROTECTVM" =~ ^[Yy]$ || "$PROTECTVM" =~ ^[yY][eE][sS] ]]
then
qm set "$VMID" --protection 1
else
qm set "$VMID" --protection 0
fi
while true
do
read -r -p "TEMPLATE VM [Y/n]: " TEMPLATEVM
case "$TEMPLATEVM" in
[yY][eE][sS]|[yY])
break
;;
[nN][oO]|[nN])
break
;;
*)
echo "INVALID INPUT, PLEASE ENTER [Y/n]"
;;
esac
done
if [[ "$TEMPLATEVM" =~ ^[Yy]$ || "$TEMPLATEVM" =~ ^[yY][eE][sS] ]]
then
qm template "$VMID"
fi
Hi,
It would be wonderful if the script could read a config file (yaml?) with all the variables already set.
In each read statement, if env is set, skip the read statement (and if needed, set the value from env, as varname differs).
I am trying to figure out where the serial console is attached but haven't found it yet.
If you remove after creation and set display to default, VM won't boot.
ANy suggestions?
Hello, when me installed script i do all steps. And on CentOS7, Debian 10 i got issue
Network not work, i set Static IP and working gateway. And cloudimage no reaction of changes, password not setting and etc.
./vmbuilder.sh: line 595: /mnt/pve/pve-cluster/snippets/10003.yaml: No such file or directory
./vmbuilder.sh: line 596: /mnt/pve/pve-cluster/snippets/10003.yaml: No such file or directory
./vmbuilder.sh: line 597: /mnt/pve/pve-cluster/snippets/10003.yaml: No such file or directory
./vmbuilder.sh: line 598: /mnt/pve/pve-cluster/snippets/10003.yaml: No such file or directory
./vmbuilder.sh: line 599: /mnt/pve/pve-cluster/snippets/10003.yaml: No such file or directory
./vmbuilder.sh: line 600: /mnt/pve/pve-cluster/snippets/10003.yaml: No such file or directory
./vmbuilder.sh: line 601: /mnt/pve/pve-cluster/snippets/10003.yaml: No such file or directory
./vmbuilder.sh: line 603: /mnt/pve/pve-cluster/snippets/10003.yaml: No such file or directory
./vmbuilder.sh: line 604: /mnt/pve/pve-cluster/snippets/10003.yaml: No such file or directory
./vmbuilder.sh: line 605: /mnt/pve/pve-cluster/snippets/10003.yaml: No such file or directory
./vmbuilder.sh: line 606: /mnt/pve/pve-cluster/snippets/10003.yaml: No such file or directory
./vmbuilder.sh: line 607: /mnt/pve/pve-cluster/snippets/10003.yaml: No such file or directory
./vmbuilder.sh: line 608: /mnt/pve/pve-cluster/snippets/10003.yaml: No such file or directory
./vmbuilder.sh: line 609: /mnt/pve/pve-cluster/snippets/10003.yaml: No such file or directory
./vmbuilder.sh: line 612: /mnt/pve/pve-cluster/snippets/10003.yaml: No such file or directory
./vmbuilder.sh: line 613: /mnt/pve/pve-cluster/snippets/10003.yaml: No such file or directory
./vmbuilder.sh: line 614: /mnt/pve/pve-cluster/snippets/10003.yaml: No such file or directory
insert mkdir -p $snippetstorage
to current line 594
I'd hate to create spam like this, but if anyone is still interested in using this script, I've forked and updated it a fair bit with newer distributions and improvements
github.com/pascal48/vmbuilder-updated
It's been almost a year since any updates on this repo have been made, so I think its safe to assume life caught up with francismunch or something like that.
ex Debian 10 Buster, instead of Debian 10
qm set $VMID --scsihw virtio-scsi-pci --scsi0 $vmstorage:vm-$VMID-disk-0,discard=on
It's
qm set $VMID --scsihw virtio-scsi-pci --scsi0 $vmstorage:$VMID/vm-$VMID-disk-0.raw,discard=on
..still generally hardcoding this stuff isn't great, but I guess it works
from input; from gh, gl, other https://something/username.keys; also allow saved options (~/.vmbuilder/sshkeys for example, /tmp is also better than nothing)
Awesome script! Could you add an option to ask if you want the VM to auto start after creation?
echo "*** Taking a 5-7 seconds to gather information ***"
it's a bit confusing, don't print anything at all
also.. the process should be initiated on script run, with &
to place it to bg. Then for the time it is needed, wait for any bg processes to complete.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.