Juju does not allocate swap for ubuntu on vmware

Bug #1873960 reported by Camille Rodriguez
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical Juju
Triaged
Low
Unassigned

Bug Description

When deploying on vmware (here vsphere 6.7), nagios complains of 0 swap for all machines, because juju does not allocate any when it deploys the units. A simple check shows that there is indeed no swap allocated to any units :

ubuntu@juju-0b35eb-0:~$ free -m
              total used free shared buff/cache available
Mem: 985 309 185 2 490 524
Swap: 0 0 0

nagios-juju-0b35eb-0-check_swap
CRITICAL 2020-04-20 17:03:04 0d 4h 39m 52s 4/4 SWAP CRITICAL - 0% free (0 MB out of 0 MB) - Swap is either disabled, not present, or of zero size.

The model deployed was a lma stack and a charmed-kubernetes bundle.

Revision history for this message
Tim Penhey (thumper) wrote :

It seems that when we are defining images for ubuntu on vsphere we are missing something to configure swap.

tags: added: vsphere-provider
Changed in juju:
status: New → Triaged
importance: Undecided → High
milestone: none → 2.8.1
Revision history for this message
Ian Booth (wallyworld) wrote :

Is this a Juju bug? IIANM we don't explicitly configure swap on images for other cloud providers.
Is there something bespoke Juju needs to do for vSphere? Are the upstream image files Juju consumes not configured correctly?

Revision history for this message
Tim Penhey (thumper) wrote : Re: [Bug 1873960] Re: Juju does not allocate swap for ubuntu on vmware

I'm not sure how the images get into vsphere for juju to consume. It is
possible that this isn't a juju bug at all, and instead there are missing
steps in the configuration of the images in vsphere itself.

On Tue, Apr 21, 2020 at 2:15 PM Ian Booth <email address hidden> wrote:

> Is this a Juju bug? IIANM we don't explicitly configure swap on images for
> other cloud providers.
> Is there something bespoke Juju needs to do for vSphere? Are the upstream
> image files Juju consumes not configured correctly?
>
> --
> You received this bug notification because you are subscribed to juju.
> Matching subscriptions: Juju bugs
> https://bugs.launchpad.net/bugs/1873960
>
> Title:
> Juju does not allocate swap for ubuntu on vmware
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/juju/+bug/1873960/+subscriptions
>

Revision history for this message
John A Meinel (jameinel) wrote :

I don't believe we set up Swap anywhere.:

juju bootstrap aws
juju ssh -m controller 0
free
ubuntu@ip-10-239-188-95:~$ free
              total used free shared buff/cache
available
Mem: 31391036 402104 28509584 788 2479348
 30594852
Swap: 0 0 0

I don't know if MAAS itself defaults to providing swap. And it would make
sense that it could be a machine constraint, but it isn't something that we
have special cased for VMWare, it just isn't something that we do generally.

On Tue, Apr 21, 2020 at 6:41 AM Tim Penhey <email address hidden> wrote:

> I'm not sure how the images get into vsphere for juju to consume. It is
> possible that this isn't a juju bug at all, and instead there are missing
> steps in the configuration of the images in vsphere itself.
>
> On Tue, Apr 21, 2020 at 2:15 PM Ian Booth <email address hidden>
> wrote:
>
> > Is this a Juju bug? IIANM we don't explicitly configure swap on images
> for
> > other cloud providers.
> > Is there something bespoke Juju needs to do for vSphere? Are the upstream
> > image files Juju consumes not configured correctly?
> >
> > --
> > You received this bug notification because you are subscribed to juju.
> > Matching subscriptions: Juju bugs
> > https://bugs.launchpad.net/bugs/1873960
> >
> > Title:
> > Juju does not allocate swap for ubuntu on vmware
> >
> > To manage notifications about this bug go to:
> > https://bugs.launchpad.net/juju/+bug/1873960/+subscriptions
> >
>
> --
> You received this bug notification because you are subscribed to juju.
> Matching subscriptions: juju bugs
> https://bugs.launchpad.net/bugs/1873960
>
> Title:
> Juju does not allocate swap for ubuntu on vmware
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/juju/+bug/1873960/+subscriptions
>

Revision history for this message
Camille Rodriguez (camille.rodriguez) wrote :

From what I understand, juju downloads a vmdk file from somewhere, which is then used to boot the vms in vmware. Shouldn't the swap be part of that template?

Ian Booth (wallyworld)
Changed in juju:
milestone: 2.8.1 → none
Revision history for this message
Ian Booth (wallyworld) wrote :

Juju does not set up swap on any cloud and at this time is not something currently under consideration.
There may be a way to do it using this cloud-init model-config attribute

https://discourse.juju.is/t/using-model-config-key-cloudinit-userdata/512

I am not sure if the vSphere images support cloud-init?

Felipe Reyes (freyes)
tags: added: sts
Revision history for this message
Camille Rodriguez (camille.rodriguez) wrote :

I used cloudinit to set the timezone for the vms in Vsphere, so yes, vSphere images support cloud-init.

Revision history for this message
Camille Rodriguez (camille.rodriguez) wrote :

So should this be a nagios bug then? It's not normal that upon deploy of our default template, we end up with red alerts in Nagios.

Revision history for this message
Pen Gale (pengale) wrote :

This is causing issues w/ CDK deployments, which do need swap.

(In other clouds, you'd specify a flavor, or instance type, and be off to the races -- we need to do something different in vSphere.)

I'd like to add this to the work we're doing on vSphere this cycle, if possible.

Revision history for this message
Pen Gale (pengale) wrote :

@freyes I ran this by the team in a hangout ... and got a little bit of pushback :-)

What charms, specifically, are failing in the absence of swap? Are they working on AWS? And what are/how terrible are the workarounds?

I know that there are some circumstances where, for example, a golang program will try to over commit on memory, and the kernel will refuse to do so if the machine doesn't have swap enabled. But it seems like this would be biting us on other clouds if there weren't already decent workarounds in the charms ...

Revision history for this message
Canonical Juju QA Bot (juju-qa-bot) wrote :

This bug has not been updated in 2 years, so we're marking it Low importance. If you believe this is incorrect, please update the importance.

Changed in juju:
importance: High → Low
tags: added: expirebugs-bot
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.