Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

azure: add PPS support for azure-proxy-agent #5601

Merged
merged 8 commits into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 21 additions & 2 deletions cloudinit/sources/DataSourceAzure.py
Original file line number Diff line number Diff line change
Expand Up @@ -577,15 +577,31 @@ def _check_azure_proxy_agent_status(self) -> None:
]
out, err = subp.subp(cmd)
report_diagnostic_event(
"Running azure-proxy-agent %s resulted"
"in stderr output: %s with stdout: %s" % (cmd, err, out),
"Executing %s resulted "
"in stderr=%r with stdout=%r" % (cmd, err, out),
logger_func=LOG.debug,
)
except subp.ProcessExecutionError as error:
if isinstance(error.reason, FileNotFoundError):
LOG.error(
"Failed to activate Azure Guest Proxy Agent: "
"azure-proxy-agent not found"
)
report_error = errors.ReportableErrorProxyAgentNotFound()
self._report_failure(report_error)
else:
report_diagnostic_event(
"Failed to activate Azure Guest Proxy Agent: "
"status check failed "
"cmd=%r stderr=%r stdout=%r exit_code=%s"
% (
error.cmd,
error.stderr,
error.stdout,
error.exit_code,
),
logger_func=LOG.error,
)
reportable_error = (
errors.ReportableErrorProxyAgentStatusFailure(error)
)
Expand Down Expand Up @@ -706,6 +722,9 @@ def crawl_metadata(self):
self._wait_for_pps_unknown_reuse()

md, userdata_raw, cfg, files = self._reprovision()
if cfg.get("ProvisionGuestProxyAgent"):
self._check_azure_proxy_agent_status()
KsenijaS marked this conversation as resolved.
Show resolved Hide resolved

# fetch metadata again as it has changed after reprovisioning
imds_md = self.get_metadata_from_imds(report_failure=True)

Expand Down
1 change: 0 additions & 1 deletion cloudinit/sources/azure/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,6 @@ def __init__(self, exception: Exception) -> None:
class ReportableErrorProxyAgentNotFound(ReportableError):
def __init__(self) -> None:
super().__init__(
"Unable to activate Azure Guest Proxy Agent."
"azure-proxy-agent not found"
)

Expand Down
Loading