### Show Installation Options Source: https://github.com/azure/walinuxagent/blob/master/README.md Displays available installation options for the Azure Linux Agent when installing from source. Useful for understanding advanced configurations. ```bash sudo python setup.py install --help ``` -------------------------------- ### WALinuxAgent Network Setup Service Error Logs Source: https://github.com/azure/walinuxagent/wiki/Known-Issues This snippet displays the log output from the `waagent-network-setup.service` indicating a failure to start due to a missing file. This error is benign and typically resolves on reboot. ```log Logs from the waagent-network-setup.service since system boot: -- Logs begin at Thu 2021-04-15 20:33:35 UTC, end at Thu 2021-04-15 20:34:40 UTC. -- Apr 15 20:33:59 p0077c1d14pm01c000002 python[1079]: /usr/bin/python: can't open file '/var/lib/waagent/WALinuxAgent-2.2.54.2/bin/WALinuxAgent-2.2.54.2-py2.7.egg': [Errno 2] No such file or directory Apr 15 20:34:01 p0077c1d14pm01c000002 systemd[1]: waagent-network-setup.service: main process exited, code=exited, status=2/INVALIDARGUMENT Apr 15 20:34:01 p0077c1d14pm01c000002 systemd[1]: Failed to start Setup network rules for WALinuxAgent. Apr 15 20:34:01 p0077c1d14pm01c000002 systemd[1]: Unit waagent-network-setup.service entered failed state. Apr 15 20:34:01 p0077c1d14pm01c000002 systemd[1]: waagent-network-setup.service failed. ``` -------------------------------- ### Install setuptools for rpm package building Source: https://github.com/azure/walinuxagent/blob/master/README.md Installs setuptools, a dependency for building rpm packages. ```bash curl https://bootstrap.pypa.io/ez_setup.py -o - | python ``` -------------------------------- ### Install Azure Linux Agent from Source (Python 2) Source: https://github.com/azure/walinuxagent/blob/master/README.md Installs the Azure Linux Agent from source using setuptools for Python 2. Use this for advanced options like custom locations. Ensure you have the necessary permissions. ```bash sudo python setup.py install --register-service ``` -------------------------------- ### Install Azure Linux Agent from Source (Python 3) Source: https://github.com/azure/walinuxagent/blob/master/README.md Installs the Azure Linux Agent from source using setuptools for Python 3. This method is for advanced users and may override distribution customizations. ```bash sudo python3 setup.py install --register-service ``` -------------------------------- ### Restart WALinuxAgent Network Setup Service Source: https://github.com/azure/walinuxagent/wiki/Known-Issues Use these commands to restart the `waagent-network-setup.service` if rebooting the VM is not an option. The exact service name may vary by distribution. ```shell systemctl restart waagent-network-setup.service ``` ```shell systemctl restart walinuxagent-network-setup.service ``` -------------------------------- ### Install deb package dependencies Source: https://github.com/azure/walinuxagent/blob/master/README.md Installs necessary development tools for building deb packages. ```bash sudo apt-get -y install ubuntu-dev-tools pbuilder python-all debhelper ``` -------------------------------- ### Configure HTTP Proxy for WALinuxAgent Service Source: https://github.com/azure/walinuxagent/blob/master/README.md This example shows how to configure HTTP proxy settings for the WALinuxAgent service using systemd drop-in files. It sets environment variables for http_proxy and https_proxy. ```bash # cat /etc/systemd/system/walinuxagent.service.d/http-proxy.conf [Service] Environment="http_proxy=http://proxy.example.com:80/" Environment="https_proxy=http://proxy.example.com:80/" # ``` -------------------------------- ### Query WALinuxAgent Version with Package Manager Source: https://github.com/azure/walinuxagent/wiki/FAQ Use the appropriate package manager command to query the installed WALinuxAgent version. This is useful for checking the version shipped with the image. ```shell # yum list WALinuxAgent # apt list WALinuxAgent # zypper info python-azure-agent ``` -------------------------------- ### Create pbuilder environment for deb packages Source: https://github.com/azure/walinuxagent/blob/master/README.md Sets up a pbuilder environment for building deb packages. ```bash sudo pbuilder create --debootstrapopts --variant=buildd ``` -------------------------------- ### Build rpm packages Source: https://github.com/azure/walinuxagent/blob/master/README.md Builds both binary and source RPM packages for WALinuxAgent. ```bash python setup.py bdist_rpm ``` -------------------------------- ### Sample operations log file snippet Source: https://github.com/azure/walinuxagent/blob/master/tests_e2e/tests/agent_ext_workflow/README.md This snippet shows the log file generated by the test extension, detailing the sequence of operations performed by the agent. ```text Date:2019-07-30T21:54:03Z; Operation:install; SeqNo:0 Date:2019-07-30T21:54:05Z; Operation:enable; SeqNo:0 Date:2019-07-30T21:54:37Z; Operation:enable; SeqNo:1 Date:2019-07-30T21:55:20Z; Operation:disable; SeqNo:1 Date:2019-07-30T21:55:22Z; Operation:uninstall; SeqNo:1 ``` -------------------------------- ### Build deb source package Source: https://github.com/azure/walinuxagent/blob/master/README.md Builds the source package for WALinuxAgent. ```bash dpkg-buildpackage -S ``` -------------------------------- ### Upgrade Azure Linux Agent from Source Source: https://github.com/azure/walinuxagent/blob/master/README.md Upgrades the Azure Linux Agent from source using setuptools. This method is intended for advanced users and requires careful consideration as it may override distribution-specific settings. ```bash sudo python setup.py install --force ``` -------------------------------- ### Sample Azure Linux Agent Configuration Source: https://github.com/azure/walinuxagent/blob/master/README.md A sample configuration file for the Azure Linux Agent (waagent.conf). This file controls various agent behaviors, including extension management, provisioning, and resource disk settings. ```yml Extensions.Enabled=y Extensions.GoalStatePeriod=6 Provisioning.Agent=auto Provisioning.DeleteRootPassword=n Provisioning.RegenerateSshHostKeyPair=y Provisioning.SshHostKeyPairType=rsa Provisioning.MonitorHostName=y Provisioning.DecodeCustomData=n Provisioning.ExecuteCustomData=n Provisioning.PasswordCryptId=6 Provisioning.PasswordCryptSaltLength=10 ResourceDisk.Format=y ResourceDisk.Filesystem=ext4 ResourceDisk.MountPoint=/mnt/resource ResourceDisk.MountOptions=None ResourceDisk.EnableSwap=n ResourceDisk.EnableSwapEncryption=n ResourceDisk.SwapSizeMB=0 Logs.Verbose=n Logs.Collect=y Logs.CollectPeriod=3600 OS.AllowHTTP=n OS.RootDeviceScsiTimeout=300 OS.EnableFIPS=n OS.OpensslPath=None OS.SshClientAliveInterval=180 OS.SshDir=/etc/ssh HttpProxy.Host=None HttpProxy.Port=None ``` -------------------------------- ### Build deb package using pbuilder Source: https://github.com/azure/walinuxagent/blob/master/README.md Builds the WALinuxAgent deb package using pbuilder. ```bash sudo pbuilder build waagent.dsc ``` -------------------------------- ### Manually Delete WALinuxAgent Unit Files Source: https://github.com/azure/walinuxagent/wiki/Known-Issues Execute these commands during VM deprovisioning to prevent the `waagent-network-setup.service` error on new VMs created from custom images. This is a preventive measure for older daemon versions. ```shell rm -rf /usr/lib/systemd/system/wa*agent-network-setup.service* rm -rf /lib/systemd/system/wa*agent-network-setup.service* ``` -------------------------------- ### Check WALinuxAgent Version Source: https://github.com/azure/walinuxagent/wiki/FAQ Displays the WALinuxAgent version, Python version, and Goal state agent version. The agent is typically located in /usr/sbin. ```shell # sudo waagent -version WALinuxAgent-2.2.20 running on ubuntu 16.04 Python: 3.5.2 Goal state agent: 2.2.26 ``` -------------------------------- ### WALinuxAgent Version Information Source: https://github.com/azure/walinuxagent/wiki/FAQ Displays the current WALinuxAgent version, Python version, and goal state agent version. Useful for diagnosing update issues. ```shell WALinuxAgent-2.2.53 running on ubuntu 18.04 Python: 3.8.2 Goal state agent: 2.2.53 ``` -------------------------------- ### View Agent Processes Source: https://github.com/azure/walinuxagent/wiki/FAQ Use the ps command to view the running processes related to the Azure Linux Agent, showing the daemon and the extension handler. ```shell # ps -ef | grep -i agent root 2058 1 0 04:49 ? 00:00:00 /usr/bin/python -u /usr/sbin/waagent -daemon root 2063 2058 2 04:49 ? 00:08:21 python -u bin/WALinuxAgent-2.2.25-py2.7.egg -run-exthandlers ``` -------------------------------- ### Test Extension Enable String Format Source: https://github.com/azure/walinuxagent/blob/master/tests_e2e/tests/agent_ext_workflow/README.md This text format represents the expected enable string for the test extension, used for asserting status messages during testing. ```text [ExtensionName]-[Version], Count: [Enable-count] ``` -------------------------------- ### Collect Agent Logs Source: https://github.com/azure/walinuxagent/blob/master/README.md Runs the log collector utility to gather relevant agent logs for debugging. Use the -full flag for more comprehensive log collection. ```bash sudo python -c 'import waagent; waagent.log.collect()' ``` ```bash sudo python -c 'import waagent; waagent.log.collect(full=True)' ``` -------------------------------- ### Restart waagent Service (CoreOS) Source: https://github.com/azure/walinuxagent/blob/master/README.md Restarts the waagent service on CoreOS using systemctl. This command is specific to systemd-based systems like CoreOS. ```bash sudo systemctl restart waagent ``` -------------------------------- ### Restart waagent Service (General) Source: https://github.com/azure/walinuxagent/blob/master/README.md Restarts the waagent service on most Linux distributions. This is a common step after upgrades or configuration changes. ```bash sudo service waagent restart ``` -------------------------------- ### Test Extension Settings Format Source: https://github.com/azure/walinuxagent/blob/master/tests_e2e/tests/agent_ext_workflow/README.md This JSON structure represents the expected settings format for the test extension, specifically the 'name' field. ```json { "name": String } ``` -------------------------------- ### Disable WALinuxAgent Provisioning in ARM Template Source: https://github.com/azure/walinuxagent/wiki/VMs-without-WALinuxAgent Use the `provisionVMAgent` flag set to `false` within the `linuxConfiguration` section of an ARM template to prevent the agent from being provisioned on a new Linux VM. ```json { "linuxConfiguration": { "provisionVMAgent": false }, } ``` -------------------------------- ### Configure WALinuxAgent for Reduced Functionality Mode Source: https://github.com/azure/walinuxagent/wiki/VMs-without-WALinuxAgent To put the WALinuxAgent into a reduced functionality mode on existing VMs, modify the `/etc/waagent.conf` file and set `Extensions.Enabled` to `y`. This mode limits extension updates while maintaining basic guest state reporting. ```yaml # Enable extension handling. Do not disable this unless you do not need password reset, # backup, monitoring, or any extension handling whatsoever. Extensions.Enabled=y ``` -------------------------------- ### Stop and Remove WALinuxAgent on Ubuntu Source: https://github.com/azure/walinuxagent/wiki/VMs-without-WALinuxAgent After provisioning a VM with `provisionVMAgent` set to `false`, you can manually stop and remove the WALinuxAgent on Ubuntu systems using systemctl and apt-get commands. ```bash systemctl stop walinuxagent sudo apt-get remove walinuxagent ``` -------------------------------- ### Restart walinuxagent Service (Ubuntu) Source: https://github.com/azure/walinuxagent/blob/master/README.md Restarts the walinuxagent service specifically on Ubuntu systems. Use this command after making changes that require the agent to be reloaded. ```bash sudo service walinuxagent restart ``` -------------------------------- ### Disable Extension Operations in ARM Template Source: https://github.com/azure/walinuxagent/wiki/VMs-without-WALinuxAgent Set the `allowExtensionOperations` flag to `false` within the `osProfile` section of an ARM template to disallow all extension operations for a virtual machine. This setting is automatically applied if `provisionVMAgent` is `false`. ```json { "osProfile": { "allowExtensionOperations": false }, } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.