-
Notifications
You must be signed in to change notification settings - Fork 372
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
Agentless #1289
Agentless #1289
Conversation
agent_disabled_file_path = conf.get_disable_agent_file_path() | ||
if os.path.exists(agent_disabled_file_path): | ||
import threading | ||
logger.warn("Disabling the guest agent by sleeping forever; " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no API to disable the agent, there's just a file on disk?
I assumed we would just stop the service, and no code would be running.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The API is in CRP, exposed through ARM/SDK/CLI. Cloud-init will honor this flag by stopping/disabling the service, but for distros without cloud-init support, I believe this is the best we can do.
@patch('azurelinuxagent.pa.provision.get_provision_handler', return_value=ProvisionHandler()) | ||
def test_daemon_agent_disabled(self, _, __, patch_run_latest): | ||
""" | ||
Agent should provision, then sleep forever when disable_agent is found |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we start the agent at all?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do not start it, the system does. If we just exit the service will be restarted. I definitely do not want to get into the business of trying to update the service from a running agent.
self.assertEqual(3, patch_write_agent_disabled.call_count) | ||
|
||
ph.handle_provision_guest_agent(provision_guest_agent='TRUE') | ||
self.assertEqual(3, patch_write_agent_disabled.call_count) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thorough! 💯
@@ -213,6 +214,18 @@ may be used for some string type configuration entries as detailed below. | |||
|
|||
### Configuration File Options | |||
|
|||
#### __Extensions.Enabled__ | |||
|
|||
_Type: Boolean_ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add this to the various waagent.conf versions in the tree. I think people are more likely to read that file than they are the web site.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call, updated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Description
Addresses #838
This introduces two new modes of operation for the agent:
Extensions disabled
This allows an end user to reduce the agent overhead when extensions are not required. This serves customers who have provisioned VMs already and cannot re-provision without the agent. To enable this mode, a new config option
Extensions.Enabled=y|n
is provided, which the user may set.When
y
(default), the agent runs without any changes.When
n
, the goal state interval is reduced to 5 minutes, and extension configuration is not processed. This should help customers who do not want to run the agent, but still need the VM to report status, handle JIT requests, and so on.Agent disabled
As of Azure.Compute 2018-06-01, a new option is provided in the ARM API to disable the Linux guest agent completely. Documentation on that is forthcoming. This API will end up setting the
ProvisionGuestAgent
flag inovf-env.xml
, which the agent will honor with this change.If that flag is set to
false
, the agent will write/var/lib/waagent/disable_agent
, and if that file exists, sleep forever. No status reports or goal state handling of any kind are processed.Once cloud-init supports this flag, the agent service will be disabled and/or removed on provision.
PR information
Quality of Code and Contribution Guidelines