Misconfigured ifcfg-eth file in template deployed RHEL 6.8 virtual machines
search cancel

Misconfigured ifcfg-eth file in template deployed RHEL 6.8 virtual machines

book

Article ID: 338810

calendar_today

Updated On:

Products

VMware vCenter Server

Issue/Introduction

Manually add double quotes to the DOMAIN value.

Symptoms:
  • The RHEL 6.8 virtual machine was deployed from a template.
  • Multiple DNS entries were added on the DNS and Domain Settings pane of the wizard.
  • When the virtual machine is booting up, you see entries similar to:

    /etc/sysconfig/network-scripts/ifcfg-eth0: line 6: name.domain.com: command not found
    Shutting down interface eth0: /etc/sysconfig/network-scripts/ifcfg-eth0: line 6: name.domain.com: command not found
    /etc/sysconfig/network-scripts/ifcfg-eth0: line 6: name.domain.com: command not found
    /etc/sysconfig/network-scripts/ifcfg-eth0: line 6: name.domain.com: command not found
    /etc/sysconfig/network-scripts/ifcfg-eth0: line 6: name.domain.com: command not found
    [ OK ]
    Shutting down loopback interface: [ OK ]
    Bringing up loopback interface: [ OK ]
    Bringing up interface eth0: /etc/sysconfig/network-scripts/ifcfg-eth0: line 6: name.domain.com: command not found
    /etc/sysconfig/network-scripts/ifcfg-eth0: line 6: name.domain.com: command not found
    Determining if ip address 10.11.12.13 is already in use for device eth0...
    /etc/sysconfig/network-scripts/ifcfg-eth0: line 6: name.domain.com: command not found
    /etc/sysconfig/network-scripts/ifcfg-eth0: line 6: name.domain.com: command not found
    ./ifcfg-eth0: line 6: name.domain.com: command not found
    [ OK ]


    Note: These entries are also seen when running a service network restart command.

Environment

  • VMware vCenter Server 5.5.x
  • VMware vCenter Server 6.0.x

Cause

This issue occurs due to the DOMAIN values not being surrounded with double quotes. As the file is read on boot and/or a network restart, the shell treats the separate DNS domains as a command, if the domains are not surrounded with double quotes.

Resolution

To resolve this issue on a virtual machine, manually add the double quotes to the DOMAIN:
  1. Open the /etc/sysconfig/network-scripts/ifcfg-eth0 file with a text editor.
  2. Edit the DOMAIN entry adding double quotes around the domain entry:

    For Example:

    DOMAIN="temp.domain.com name.domain.com domain.com"
     
  3. Save the file and reboot the virtual machine.

To correct this issue for future template deployments, edit the RHEL6Customization.pm file on the vCenter Server machine:
  1. Open the RHEL6Customization.pm file in a plain text editor.

    Note: The file is located at:
    Windows: C:\Program Files\VMware\vCenter Server\vpxd\imgcust\linux\imgcust-scripts\RHEL6Customization.pm
    vCenter Server Appliance: /usr/lib/vmware-vpx/imgcust/linux/imgcust-scripts/RHEL6Customization.pm
  2. Change the following line:
    push(@content, "DOMAIN=" . join(' ', @$dnsSuffixes) . "\n");
    to:
    push(@content, "DOMAIN=\"" . join(' ', @$dnsSuffixes) . "\"\n");
  3. Save the file.