More robust HA upgrade in machine agent

If upgrading mongo to HA only partially
completes such that the replicaset is not
initiated, then we would previously failed
on the second attempt. Make sure we use
"Direct" connections when upgrading to HA.

Possibly fixes https://launchpad.net/bugs/1334273
Don't expose the user command yet
Merge pull request #193 from axw/machine-agent-upgrade-ha-robustness-1.20

More robust HA upgrade in machine agent

If upgrading mongo to HA only partially
completes such that the replicaset is not
initiated, then we would previously failed
on the second attempt. Make sure we use
"Direct" connections when upgrading to HA.

Possibly fixes https://launchpad.net/bugs/1334273
Merge pull request #194 from howbazaar/1.20-disable-user

Don't expose the user command yet

Just for the 1.20 release. Still enabled on master.

The user command is undergoing more change with the upcoming identity work. Rather than publicly expose something that we know is changing soon, just keep it disabled.

The enabling was introduced during 1.19.
cmd/jujud: synchronise upgrade steps and ensureMongoServer

It's possible for the upgrade steps to complete before the
state worker starts, thus preventing it from initialising
mongo properly on upgrade. This PR makes it so that the
upgrade steps runner waits for ensureMongoServer to finish
before proceeding.

Maybe fixes https://bugs.launchpad.net/juju-core/+bug/1334273
utils/ssh: set ServerAliveInterval option

Bootstrapping Azure was seeing the CLI
hang at "apt-get upgrade" with no further
output or command completion. Inspection
of cloud-init-output.log on the server
showed that the bootstrap procedure
completed successfully.

The problem appears to be due to the
"apt-get upgrade" taking a long time on
Azure: over 6 minutes. This inactivity
causes the ssh server to discontinue sending
output to the client. To resolve the issue
we need to ensure the ssh client sends
keepalive messages to the server.

Fixes https://bugs.launchpad.net/juju-core/+bug/1316185
provider/azure: use affinity group in vnet site

Revert change based on observations of vnet
related issues. Azure console displays advisory
warning about vnets tied to locations, suggesting
vnets be tied to affinity groups to mitigate.
Merge pull request #202 from axw/lp1334273-upgrade-ha-race-1.20

cmd/jujud: synchronise upgrade steps and ensureMongoServer

It's possible for the upgrade steps to complete before the
state worker starts, thus preventing it from initialising
mongo properly on upgrade. This PR makes it so that the
upgrade steps runner waits for ensureMongoServer to finish
before proceeding.

Maybe fixes https://bugs.launchpad.net/juju-core/+bug/1334273
Merge pull request #204 from axw/azure-network-affinitygroup-1.20

provider/azure: use affinity group in vnet site

Revert change based on observations of vnet
related issues. Azure console displays advisory
warning about vnets tied to locations, suggesting
vnets be tied to affinity groups to mitigate.
Merge pull request #203 from axw/lp1316185-ssh-keepalive-1.20

utils/ssh: set ServerAliveInterval option

Bootstrapping Azure was seeing the CLI
hang at "apt-get upgrade" with no further
output or command completion. Inspection
of cloud-init-output.log on the server
showed that the bootstrap procedure
completed successfully.

The problem appears to be due to the
"apt-get upgrade" taking a long time on
Azure: over 6 minutes. This inactivity
causes the ssh server to discontinue sending
output to the client. To resolve the issue
we need to ensure the ssh client sends
keepalive messages to the server.

Fixes https://bugs.launchpad.net/juju-core/+bug/1316185