[VMConAWS] Ip customization might fail during recovery of a RHEL Virtual Machine by SRM
search cancel

[VMConAWS] Ip customization might fail during recovery of a RHEL Virtual Machine by SRM

book

Article ID: 313732

calendar_today

Updated On:

Products

VMware Live Recovery VMware Cloud on AWS

Issue/Introduction

To help identify the reason for customization failure and remediate.

Symptoms:
You may see error "Cannot complete customization, possibly due to a script runtime error or invalid script parameters (Error code :255). IP settings may have been partially applied.



SRM logs /Logs/vmware-dr.log shows error as below 

-> 2023-10-15T09:04:08 DEBUG: opening file for writing (/etc/resolv.conf).
--> 2023-10-15T09:04:08 DEBUG: Permission denied writing data to file /etc/resolv.conf.
--> 2023-10-15T09:04:08 INFO: File Attributes: /etc/resolv.conf
--> 2023-10-15T09:04:08 DEBUG: Command: 'lsattr /etc/resolv.conf'
--> 2023-10-15T09:04:08 DEBUG: Exit Code: 0
--> 2023-10-15T09:04:08 DEBUG: Result: ----i----------- /etc/resolv.conf
--> 
--> 2023-10-15T09:04:08 INFO: File stat: /etc/resolv.conf
--> 2023-10-15T09:04:08 DEBUG: Command: 'stat /etc/resolv.conf'
--> 2023-10-15T09:04:08 DEBUG: Exit Code: 0
--> 2023-10-15T09:04:08 DEBUG: Result:   File: ‘/etc/resolv.conf’
-->   Size: 98          Blocks: 8          IO Block: 4096   regular file
--> Device: fd00h/64768d        Inode: 376565      Links: 1
--> Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root) 

......

-->  : [error] Deploy error: 'Deployment failed.The forked off process returned error code.'.
-->  : [info] Deploying package status : 2
-->
-->  : [info] ------------------------------------------------
--> Exit code: 255
--> ",
-->                returnValue = 255
-->             }
-->             msg = "Cannot complete customization, possibly due to a scripting runtime error or invalid script parameters (Error code: 255). IP settings may have been partially applied."
-->          },
-->          (dr.recovery.fault.IPCustomizationFailure) {
-->             faultCause = (vmodl.MethodFault) null,
-->             faultMessage = <unset>,
-->             result = (dr.recovery.CalloutResult) {
-->                commandLine = "echo "Starting IP customization on Linux ..." >> "$VMware_GuestOp_OutputFile"



Cause

Failure to update the /etc/resolv.conf is due to immutable attribute set on the file. Customization script in SRM will check the attribute via 'lsattr /etc/resolv.conf' and if the result is as shown above in symptoms, it will result in permission error and customization task failure.

Resolution

  • Ensure latest version of open-vm-tools is installed. 
  • To resolve the issue and be able to recover the Virtual machine execute below command at the source Virtual machine. 
      chattr -i /etc/resolv.conf 
  • The above command will remove the immutable attribute on the file and then retry a test or recovery on the Virtual machine. 


Workaround:
As a workaround please refer Create Message Prompts or Command Steps for Individual Virtual Machines  to include the command suggested in resolution section during recovery plan setup and prompt users during task execution.

Additional Information

Impact/Risks:
Recovery of RHEL virtual machines will fail during the customization phase.