canonical / ubuntu-pro-client

Ubuntu Pro Client for offerings from Canonical
https://canonical-ubuntu-pro-client.readthedocs-hosted.com/en/latest/
GNU General Public License v3.0
52 stars 73 forks source link

Provide a better messaging in air-gapped environments #2726

Open carlosbravoa opened 1 year ago

carlosbravoa commented 1 year ago

Context: When launching a Pro instance in an air-gapped environment, pro status fails to actually show the status and gives this error after one minute of timeout:

Failed to connect to authentication server
Check your Internet connection and try again.

We should be more explicit about the problem and maybe still show the status.

Moreover, the machine's MOTD gives the following error:

Failed to automatically attach to Ubuntu Pro services 1 time(s).
The failure was due to: an error while reaching https://contracts.canonical.com/v1/clouds/aws/token: "timed out".
The next attempt is scheduled for 2023-08-30T18:10:00+00:00.
You can try manually with `sudo pro auto-attach`.

So the point is to help the customer to understand that they aren't getting anything, since Pro is not active. This is important because they are getting billed by AWS anyways and customers may not even realize that they are not on Pro

orndorffgrant commented 1 year ago

@carlosbravoa I agree that pro status should provide more information here.

Do you think the information in MOTD is helpful? Or do you think that isn't sufficient either?

carlosbravoa commented 1 year ago

This could be an interesting discussion with the broader team. Because we need to tell the customer in a simple way that Ubuntu Pro is not active. For us it means it didn't attach correctly, but for the customer may need a simpler way to say it. We could also include a link to a specific landing page explaining network requirements and what to do if the customer wants to run it air-gapped.

orndorffgrant commented 1 year ago

This could be an interesting discussion with the broader team.

Totally - I'd be happy to participate in a sync discussion.

Because we need to tell the customer in a simple way that Ubuntu Pro is not active. For us it means it didn't attach correctly, but for the customer may need a simpler way to say it. We could also include a link to a specific landing page explaining network requirements and what to do if the customer wants to run it air-gapped.

For network connectivity issues in general. We have this page we could link to: https://canonical-ubuntu-pro-client.readthedocs-hosted.com/en/latest/references/network_requirements.html

But that won't help an airgapped setup. If an airgapped auto-attach instance gets as far as trying to talk to contracts.canonical.com, then the image is wrong. pro-client will need to be pre-configured on the image to talk to the on-prem airgapped contract server. Or, there might be a way to do it with cloud-init prior to auto-attach - and that might actually be preferable since it's more flexible.

orndorffgrant commented 4 days ago

@carlosbravoa Re-visiting this a year later. Is this still a problem?

The whole concept of using Pro auto-attached images inside an airgapped environment would require an airgapped contract server that supports auto-attaching.

We're not sure what pro-client should be doing differently here, aside from clearly stating that you're unattached for pro status in this case.

carlosbravoa commented 4 days ago

This is how it looks like today:

ubuntu@ip-172-31-34-6:~$ pro status
Failed to connect to https://contracts.canonical.com/v1/resources?architecture=amd64&kernel=6.8.0-1015-aws&series=jammy&virt=xen
[Errno 101] Network is unreachable

It should at least show you a message like "This machine is not attached to a Pro subscription". No every user will know how to do a more advanced query to the pro client.

Thanks!