canonical / postgresql-operator

A Charmed Operator for running PostgreSQL on machines
https://charmhub.io/postgresql
Apache License 2.0
8 stars 19 forks source link

Charm cannot be installed on an Juju managed LXD machine. #354

Closed moisesbenzan closed 5 months ago

moisesbenzan commented 9 months ago

Steps to reproduce

  1. juju deploy --channel 14/edge --model postgresql --to lxd postgresql

Expected behavior

Unit would be assigned correctly to an LXD machine provisioned via Juju

Actual behavior

Model       Controller       Cloud/Region   Version  SLA          Timestamp
postgresql  foundations-aws  aws/us-east-1  3.1.7    unsupported  23:21:51

App         Version  Status  Scale  Charm       Channel  Rev  Exposed  Message
postgresql           error     0/1  postgresql  14/edge  367  no       cannot assign unit "postgresql/0" to machine 0/lxd/0: adding storage to lxd container not supported

Unit          Workload  Agent  Machine  Public address  Ports  Message
postgresql/0  error     lost                                   cannot assign unit "postgresql/0" to machine 0/lxd/0: adding storage to lxd container not supported

Machine  State    Address  Inst id  Base          AZ  Message
0        pending           pending  ubuntu@22.04      Verifying availability zone
0/lxd/0  pending           pending  ubuntu@22.04      

Versions

Operating system: Ubuntu 22.04

Juju CLI: 3.1.7

Juju agent: 3.1.7

Charm revision: 14/edge 367

LXD: 5.0.3-51452c3, rev. 26881

Log output

Juju debug log: Not captured in this run.

Additional context

github-actions[bot] commented 9 months ago

https://warthogs.atlassian.net/browse/DPE-3566

dragomirp commented 9 months ago

Hi, @moisesbenzan, are there any storage pools available to Juju? It looks to me that Juju can't provision a volume for Postgresql.

taurus-forever commented 9 months ago

@moisesbenzan Is it still reproducible after adding storage pool? @dragomirp anything we can add to our charm to print better error message/hint to users?

dragomirp commented 9 months ago

I think this behaviour is entirely controlled by Juju.

jeffreychang911 commented 8 months ago

Below is my test on top of openstack.

Confirm there's cinder storage-pools available. ubuntu@lab1-silo1-cpe-d05f9225-46c2-4172-b113-4ec9bf8c0968:~/project$ juju storage-pools Name Provider Attributes cinder cinder
loop loop
rootfs rootfs
tmpfs tmpfs

Deploy postgresql with juju deploy --channel 14/stable --model postgresql postgresql --to lxd --storage pgdata=cinder,1G, but still got same error, cannot assign unit "postgresql/0" to machine 0/lxd/0: adding storage to lxd container not supported

Found an old discussion - https://chat.charmhub.io/charmhub/pl/obumb6guybf8fmm4jhj9w1tuxh, which seems to be a charm problem? And same problem also happens to mysql https://github.com/canonical/mysql-operator/issues/408

phvalguima commented 8 months ago

Hi @jeffreychang911 @moisesbenzan that behavior is controlled by juju. I have issued this bug with them: https://bugs.launchpad.net/juju/+bug/2060098

Would be nice meanwhile to avoid LXCs for DB and deploy the workloads directly on VMs instead.

taurus-forever commented 8 months ago

My $0.05, I second to @dragomirp and @phvalguima: it is the current limitation of Juju, IMHO.

re: Found an old discussion - https://chat.charmhub.io/charmhub/pl/obumb6guybf8fmm4jhj9w1tuxh, which seems to be a charm problem?

@jeffreychang911 I disagree. The reply there is: ... the ubuntu charm recently added the use of (Juju) storage which is not supported for lxd containers (inside VMs as for now?). You can use an older version of the ubuntu charm (which is not using Juju storage). My commends added there inside into (...).

All the modern Data team charms (PostgreSQL, MySQL, MongoDB, ... ) uses juju storage. Let's continue in https://bugs.launchpad.net/juju/+bug/2060098 and see the Juju team feedback there.

P.S. we are happy to improve something on our side here, but on this stage our charm.py code is not yet even launched.

taurus-forever commented 8 months ago

We've got reply from Juju Team: Juju doesn't support this. (c) https://bugs.launchpad.net/juju/+bug/2060098/comments/1

Resolved as nothing to fix in PostgreSQL charm?

jeffreychang911 commented 8 months ago

That would be ok, thanks.

taurus-forever commented 5 months ago

Resolving as agreed.