Link to home
Start Free TrialLog in
Avatar of Goutham
GouthamFlag for India

asked on

how to setup LXD on ubuntu

Dear Experts

I am planning use OVH bare metal server to setup multiple LXD containers, please help is the below config will be best to start with for mainly LAMP stack and around two Linux servers in total around 15 sites but all are of development environment approx 03 to 05 users will be working on each container,
I would require dedicated Ip for each server because each of the server will be with FQDN and access to the respective team.

Please help me on the following 03 questions
  1. Which one of the below is recommend
https://www.ovhcloud.com/en/bare-metal/rise/prices/
Rise-2New configuration
Processor: Intel i7-7700K - 4 c / 8 t - 4.2 GHz / 4.5 GHz
 Memory: From 32GB
 Storage: NVMe, SATA available
Public bandwidth: 500 Mbps
 Private bandwidth:
 
Rise-3Price drop
Processor: Intel Xeon E5-1650v4 - 6 c / 12 t - 3.6 GHz / 4 GHz
 Memory: From 64GB
 Storage: NVMe, SATA available
Public bandwidth: 500 Mbps
 Private bandwidth: -
 
Rise-3Price drop
Processor: Intel Xeon E5-1650v4 - 6 c / 12 t - 3.6 GHz / 4 GHz
 Memory: From 64GB
 Storage: NVMe, SATA available
Public bandwidth: 500 Mbps
 Private bandwidth: -
 
 
2. When I select the config I can see the ubuntu distro of highest version available over there is Ubuntu Server 18.04 LTS.  Should I have to chose this distro and if yes should I have to proceed with minimal install OR  should contact them for Ubuntu 20.04.1 LTS (Focal Fossa) minimal install – please suggest
a) once installed with minimal then what packages to be installed for LXD please suggest

3. please help on routing script how to for all the containers

Thank you


Avatar of skullnobrains
skullnobrains

1/

that would depend on the traffic expected on said sites.

without any significant traffic, a pentium 4 with 4Gb of ram would be plenty.

2/

unless you can find a significant benefit of using ubuntu 20, there is imho no reason to bother and lots of reasons not to
tell us the number of concurrent users you expect.

the main bottleneck will be the database so you should focus on that.
a single unindexed query joining a few large tables requires more I/O than servicing tens of thousand of web pages.
if you have sites that will require significant query complexity, please try and provide some context : size of tables, cardinality, ...

ASKER CERTIFIED SOLUTION
Avatar of David Favor
David Favor
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Goutham

ASKER

Sir, I went for ovh dedicated server and installed ubuntu Focal as a OS option, I received email about installation completion but waiting for the password, I am able to reach the server via ssh as below but I have not been provided password by them
Using username "ubuntu".
ubuntu@51.89.233.107's password:


SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Goutham

ASKER

Thanks sir for the update, I received the email which following details and when click on the password url it shows login details with secret copied that and used for ssh login it does not work. have contacted them 

Congratulations! Your dedicated server has just been installed!
Your server OS is : Ubuntu Server 20.04 "Focal Fossa"
The account "ubuntu" has been configured (access to server via SSH)
Password can be retrieve at this url :
Avatar of Goutham

ASKER

Sir, I am able to login I was trying to past the password from the url as it was lengthy but tried to enter manually then it worked, I am able to login now. thanks.
Avatar of Goutham

ASKER

Hi Sir
in one of the post you had mentioned

 "Add the following files to /etc/sysctl.d, else you'll end up with many oddball failures inside container"

net13 # for file in * ; do echo "# file: $file" && cat $file ; done
# file: 40-max-pids.conf
kernel.pid_max=1000000
# file: 40-max-user-watches.conf
fs.inotify.max_queued_events=1048576
fs.inotify.max_user_instances=1048576
fs.inotify.max_user_watches=1048576
# file: 40-raid-resync-speed.conf
dev.raid.speed_limit_max=1000
# file: 40-swappiness.conf
vm.swappiness=0

in server in the following file /etc/sysctl.d/ 99-sysctl.conf  should i have to add the above lines OR is there any files to be created please help.




Avatar of Goutham

ASKER

Sir, have created following files in /etc/sysctl.d
# file: 40-max-pids.conf
kernel.pid_max=1000000

# file: 40-max-user-watches.conf
fs.inotify.max_queued_events=1048576
fs.inotify.max_user_instances=1048576
fs.inotify.max_user_watches=1048576

# file: 40-raid-resync-speed.conf
dev.raid.speed_limit_max=1000

# file: 40-swappiness.conf
vm.swappiness=0

after creating the above executed the following  
# for file in * ; do echo "# file: $file" && cat $file ; done
is this correct please suggest, also what this above for command will do, please help me understand, thanks.


SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Goutham

ASKER

thank you very much sir, as always best solution from you. thanks sir
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Goutham

ASKER

thank you sir, to be honest your support is the key for my successful working. thanks once again. at the moment I would require at higher side for next 6 months around 25 to 30 IP's and for this month/next month I may require 10 IP's.
instead of purchasing higher capacity ( max allowed 256 ip's) I would like to go for 32 IP address and later increase as needed, is this okay to plan this way, later if added next block, will it affect the existing config please help me on this

2.  also while purchasing should I have to go for  RIPE IP address ( the dedicated server rented in UK london) please help
Avatar of Goutham

ASKER

Sir, purchased  IPs of block 51.195.168.16/28,  and followed the steps as per below

To remove all APT LXC + LXD packages executed the following

#apt-get -y purge $(dpkg -l | awk '{ print $2; }' | egrep -e ^lxc -e ^lxd)

later to install
#snap install lxd

got the following output
#snap install lxd
snap "lxd" is already installed, see 'snap help refresh'
#lxd init --auto --storage-backend=dir
#lxc network attach-profile lxdbr0 default 51.79.18.222 # dedicated server IP#
#ip -4 route add 51.195.168.16/28 dev lxdbr0 # ip block that purchased#

upto above it worked as expected but I am stuck here below

 lxc init ubuntu:focal/x86_64 net16-template-focal
Creating net16-template-focal
Error: Failed instance creation: The requested image couldn't be found

please help on this, should I have to install or something missing please help.


Avatar of Goutham

ASKER

Sir, it worked with following
lxc init ubuntu:18.04 net16-template-focal
Excellent!

LXD is like crack. Once you start using, it's hard to go back...
like ;) !

i did manage to unhook, though... previous experience with bsd jails probably helped... cracking is quite addictive too but leaves more stigma ;)
@skullnobrains - Good one!