Configure OS Networking Through Workflow Steps
The Configure OS Networking step allows you to assign network settings in the guest OS. You can add this workflow step to a completion workflow or a command workflow.
This step works with or without an IP address management (IPAM) integration. With IPAM integration, currently only BlueCat™ IPAM is supported.
Required Credentials on Windows
The Configure OS Networking workflow step requires elevated privileges. For Windows, if the credentials used are those of a member of the administrator group, as opposed to the actual administrator account itself, you will likely need to disable UAC (user access control) on your templates.
Required Credentials on Linux
If you supply non-root-user credentials, the sudo command is used. When connecting with either VMware Tools or SSH (which is only useful for configuring secondary network interfaces), Commander supplies the password to the sudo command in advance, so there is no sudo prompt.
Ensure that the
sudoers file on the target VM does not contain the following line:
See Port Requirements.
Operating Systems Supported
This step is supported for:
- Windows 2008 R2 or later
- SUSE Linux
- Red Hat Linux
- CentOS Linux
- Debian Linux
- Ubuntu Linux version 18.04 or later
- By default, the Configure OS Networking workflow step is supported only for Linux VMs with the SSH endpoint configured. Configure OS Networking steps executed on an Azure Windows VM will fail with the following error:
VM "<vm-name>" has no valid network address: can't run guest command.
Create a case through the Snow Support Portal to learn how to configure an advanced system property to change this behavior.
- If you experience issues when running the Configure OS Networking step on CentOS or Red Hat Linux, the OS may be caching MAC addresses. Try clearing the cache before configuring the workflow step; otherwise, if caching is occurring, the OS will try to create a new interface device.
To clear the MAC address cache, run the following command as root user:
# rm -f /etc/udev/rules.d/70-persistent-net
Guest Tools Requirements
- vCenter VMs: Guest Tools (either VMware Tools or Open Virtual Machine Tools) must be current and running, so that Commander can obtain the IP address and run the guest OS command.
- SCVMM VMs: The latest guest integration services is required to obtain the IP address. To run the command in the guest OS, Commander uses SSH for Linux VMs. To run commands on Windows VMs, scripting using WinRM is required.
Options for IP address assignment
With a Configure OS Networking step, there are three ways for IP addresses to be assigned:
- From Commander IP Pool
With this option, you must configure IP pools.
When you select All Adapters from the Adapters drop-down menu, the workflow step retrieves the number of NICs from the VM, reserves the IP addresses from the IP pool, and assigns the IP addresses to the respective adapters in the target guest OS.
- From Deployment Parameters
Assign an IP address when the request is approved. When you choose this option:
- You can specify network settings in the workflow step itself.
- Administrators can specify network settings using deployment parameters (obtained either through substitution variables or REST API calls) when approving the request. With this option, an administrator must provide values for all settings which have not been defined in the Configure OS Networking step itself, plus the IP address(es); otherwise, the workflow step will fail.
You can use REST API calls to assign IPs for completion workflows but not for command workflows because deployment parameters are associated with a specific component in a service in a request. This isn't the case with substitution variables.
Note that settings specified in the workflow step itself can be overridden by approval comments.
- From BlueCat™ IPAM
Create host records or DHCP reservations from BlueCat™ IPAM during provisioning. You must integrate Commanderwith a BlueCat™ server first. To set this up, see Integrate BlueCat™ IP Address Management.
Internet protocol support
The Subnet Mask, Gateway and DNS must be valid IPv4 IP addresses (IPv6 isn't supported).
Configure networking through a change request
When using this step for a change request workflow, note the following:
- For Linux, the
/etc/sysconfig/network-scripts/ifcfg-eth0(for example) are overwritten during a change request, so any previous configuration will be lost.
- Change requests are supported only for workflow steps that are configured to use approver comments (that is, from the Step Details section, you must choose Assign IP > When Approving a Request).
Troubleshooting and auditing Guest OS workflow steps
If a guest OS command succeeds, the comment log provides an audit record of what was run on the guest OS.
If a guest OS command run in a workflow step through VMware Tools or SSH fails, the command and its output from the guest OS is captured in the comment log. There is no need to go to the Commander log for this information. You can try to run the failed command outside of Commander to troubleshoot the step.
For the Run Program workflow step, set the Program Output field to "Capture program output as comment". For the Configure Networking steps, program output is always captured as a comment.
Example: Troubleshooting a Run Program workflow step
For example, you go to Tools > Workflow Status and see that one of your workflows has an Error status, as shown below.
In this case, you can select the row in the table and click Manage Workflow to see details for the workflow. You can also click the Comments tab to see detailed troubleshooting information. For Guest OS steps, the full syntax of the command that failed is included.
You can click the Edit Step hyperlink to edit the failed workflow step.