-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
QA-4202 Add lxc deploy scripts #1
Conversation
lxc/Deploy.sh
Outdated
# size: 30GiB | ||
# description: "" | ||
# name: default | ||
# driver: zfs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is zfs
a default storage driver for LXC/Jepsen? Does it need additional kernel modules to be installed? AFAIK, it's not shipped with vanilla Linux kernel.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made config as example, not mandatory. What storage can you recommend?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something available by default in the most popular distributions (like Ubuntu)
lxc/Deploy.sh
Outdated
#export USER=abelyak | ||
|
||
export CONTAINERS=10 | ||
export NETPREF=192.168.122 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One more hardcoded value. It wouldn't work for any user with different network. Prefix must be either detected automatically or - most probably - passed from the outside as a script argument.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add notice into README.md to keep the script simple with fewer parameters.
lxc/Deploy.sh
Outdated
|
||
#export USER=abelyak | ||
|
||
export CONTAINERS=10 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably, we should also pass this parameter from the outside of the script
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add notice into README.md to keep the script simple with fewer parameters.
lxc/Deploy.sh
Outdated
|
||
function setup { | ||
echo "01. Create" | ||
for (( i=1; i<=$CONTAINERS; i++ )) do lxc-create -n n$i -t debian -- --release buster; done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about user's privileges for lxc-command
and other commands? Does a user require sudo
for them, or does it need to belong to some group? These commands are not available for everybody in the system.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
README.md: requires root privileges
lxc/Deploy.sh
Outdated
service networking restart | ||
|
||
echo "07. Copy keys to the lxc containers" | ||
export KEYFILE=/home/$USER/.ssh/id_rsa.pub |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's move this variable near the top of the script.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
lxc/Deploy.sh
Outdated
@@ -0,0 +1,188 @@ | |||
#!/bin/bash | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since almost every step require that all previous steps are executed successfully, I believe we should add set -e
exit the script on any error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DONE
lxc/Deploy.sh
Outdated
|
||
function start { | ||
echo "09. Start lxc containers" | ||
set -xe |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Place on top?
lxc/README.md
Outdated
# Possible errors: | ||
|
||
# 1) If you get keyring error like: The specified keyring /var/cache/lxc/debian/archive-key.gpg may be incorrect or out of date | ||
# Just download the new keys and import it with: | ||
# | ||
# wget "https://ftp-master.debian.org/keys/release-10.asc" | ||
# sudo gpg --no-default-keyring --keyring /var/cache/lxc/debian/archive-key.gpg --import release-10.asc | ||
|
||
# 2) If you get an error tryint to run virsh commands like: | ||
# error: failed to connect to the hypervisor | ||
# error: Failed to connect socket to '/var/run/libvirt/libvirt-sock': No such file or directory | ||
# | ||
# Install kvm with: | ||
# sudo apt install qemu qemu-kvm libvirt-clients libvirt-daemon-system virtinst bridge-utils | ||
# sudo systemctl enable libvirtd | ||
# sudo systemctl start libvirtd |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix formatting please
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
No description provided.