Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
[The config instructions show the device for the created block storage.](httpss://assets.digitalocean.com/articles/lxdcontainersubuntu_1604/6rDyC1l.png)
There’s an extra s in the link which is preventing the image from displaying properly.
This is great, thanks for providing this tutorial.
Could anyone give me some guidance as to how I can set up SSL for the sites on my containers? and how to configure HAProxy to redirect to them?
I want to set up letsencrypt on each, and am having some problems. Do I set this up on the HAProxy container? The others which are running a web service, or all of them?
I’m trying to follow this tutorial with block storage on ubuntu 17.04 and have come across an error.
Configuration for the block storage shows it was successful.
ls /mnt/volume-tor1-01
lost+found
On ubuntu 17.04 the setup steps were slightly different than in this tutorial but appear to be mostly the same.
sudo lxd init
Do you want to configure a new storage pool (yes/no) [default=yes]?
Name of the new storage pool [default=default]: lxd
Name of the storage backend to use (dir, btrfs, lvm, zfs) [default=zfs]: zfs
Create a new ZFS pool (yes/no) [default=yes]? yes
Would you like to use an existing block device (yes/no) [default=no]? yes
Path to the existing block device: /dev/disk/by-id/scsi-0DO_Volume_volume-tor1-01
Would you like LXD to be available over the network (yes/no) [default=no]?
Would you like stale cached images to be updated automatically (yes/no) [default=yes]?
Would you like to create a new network bridge (yes/no) [default=yes]?
What should the new bridge be called [default=lxdbr0]?
What IPv4 address should be used (CIDR subnet notation, “auto” or “none”) [default=auto]?
What IPv6 address should be used (CIDR subnet notation, “auto” or “none”) [default=auto]?
But I get this error,
error: Failed to create the ZFS pool: the kernel failed to rescan the partition table: 16
cannot label 'sda': try using parted(8) and then provide a specific slice: -1
And the block storage file system becomes corrupted.
ls /mnt/volume-tor1-01
ls: reading directory '/mnt/volume-tor1-01': Structure needs cleaning
Any ideas of what the problem is?
The final step returned:
* Rebuilt URL to: 178.62.42.247/
* Trying 178.62.42.247...
* Connected to 178.62.42.247 (178.62.42.247) port 80 (#0)
> GET / HTTP/1.1
> Host: russellbishop.co.uk
> User-Agent: curl/7.47.0
> Accept: */*
>
< HTTP/1.1 403 Forbidden
< Server: nginx/1.10.0 (Ubuntu)
< Date: Sun, 25 Jun 2017 19:56:34 GMT
< Content-Type: text/html
< Content-Length: 178
< Connection: keep-alive
<
<html>
<head><title>403 Forbidden</title></head>
<body bgcolor="white">
<center><h1>403 Forbidden</h1></center>
<hr><center>nginx/1.10.0 (Ubuntu)</center>
</body>
</html>
* Connection #0 to host 178.62.42.247 left intact
Server ip is 178.62.42.247
Very good tutorial!
Just a little detail. In the code headings, it should be: “/etc/haproxy/haproxy.cfg” And not: “/etc/haproxy/haproxy.conf”
I did a “nano” there, but ok ;)
Hello, why did you use HAProxy instead of Nginx for the reverse proxy? I am familiar with nginx and I would like to use nginx for the reverse proxy as well. Can you tell me why you chosed HAProxy for the reverse proxy? Thank you a lot!
Hello, thanks for this great tutorial. I followed all the steps and everything went good until I reach the last one (step 6). When I execute this command: curl --verbose --header ‘Host: example.com’ ‘http://192.168.0.7’ I get Connection refused error. Here’s the full output that I get:
I’m new to LXD, any help will be appreciated :)
This is absolutely brilliant! Thank you Simos. This is a way more elegant hosting scheme for my websites. You made everything easier for me. I’d tip you right now for this.
Hi everyione, I’m having problem with haproxy container. Here my container config, lxc list
| haproxy | RUNNING | 192.168.0.39 (eth0) | 2a01:e0a:281:62a0:216:3eff:fe25:b45c (eth0) |
| web1 | RUNNING | 192.168.0.30 (eth0) | 2a01:e0a:281:62a0:216:3eff:fe88:7c7c (eth0) | ----------------+-----------+-----------+
| web2 | RUNNING | 192.168.0.59 (eth0) | 2a01:e0a:281:62a0:216:3eff:fe15:26e3 (eth0) |
haproxy config, these dns are from noip dinamyc dns pointing to my ip public router
frontend www_frontend
bind *:80 # Bind to port 80 (www) on the container
# It matches if the HTTP Host: field mentions any of the hostnames (after the '-i').
acl host_web1 hdr(host) -i nojoda.webhop.me
acl host_web2 hdr(host) -i arepitas-alsace.servebeer.com
# Redirect the connection to the proper server cluster, depending on the match.
use_backend web1_cluster if host_web1
use_backend web2_cluster if host_web2
Error output.
[ALERT] 299/142117 (1107) : parsing [/etc/haproxy/haproxy.cfg:55] : 'server web1' : invalid address: 'web1.lxd' in 'web1.lxd:80'
[ALERT] 299/142117 (1107) : parsing [/etc/haproxy/haproxy.cfg:60] : 'server web2' : invalid address: 'web2.lxd' in 'web2.lxd:80'
Any help, please Thanks¡