Guest OS Customization Fails with customization halted on Linux VM due to Immutable File Attribute
search cancel

Guest OS Customization Fails with customization halted on Linux VM due to Immutable File Attribute

book

Article ID: 431165

calendar_today

Updated On:

Products

VMware vCenter Server VMware vSphere ESXi

Issue/Introduction

The Guest OS Customization process cannot apply network settings or a unique identity when deploying a VM from a Linux template despite the valid specification assigned in vCenter. Because the system retains default values the critical files /etc/hostname and /etc/hosts remain unchanged.

  • /var/log/vmware-imc/toolsDeployPkg.log on the failed VM
    [YYYY-MM-DDTHH:MM:SS] ERROR: Fatal error occurred during customization !! Customization halted
    [YYYY-MM-DDTHH:MM:SS] ERROR: Error : Operation not permitted: Error writing data to file (/etc/sysconfig/network). Operation not permitted at /var/run/.vmware-imgcust-dPMTCAb/scripts/Utils.pm line 655.

Cause

This issue occurs when a network configuration file on the guest OS has the immutable attribute set. This attribute locks a file against modification, deletion, or renaming, even by the root user, preventing the vmtoolsd process from updating necessary files during customization.

Resolution

To resolve this issue, the immutable flag must be removed from the affected configuration file within the source template.

  1. Convert the template to a virtual machine. Refer to: Converting a template to a virtual machine (VM)
  2. Update file permissions to remove immutability

    1. Power on the VM and access the guest OS console to identify and remove the attribute.

    2. Review this command before running it.
      lsattr /etc/sysconfig/network

    3. This command will make changes to your system. Review it carefully before running.
      sudo chattr -i /etc/sysconfig/network

  3. Convert the VM to a template. Refer to: Clone a Virtual Machine to a Template
  4. Use the customization specification to redeploy a new VM from the updated template.