VMware Cloud Community
MG_SYM
Contributor
Contributor

VMimages symlink getting deleted with updates

Hello,

I have VCenter 5.1,  I have iso images locted on a datastore, to make them available for users i create a symlink in "/vmimages". So far everything is working great BUT everytime a host is updated i get that symlink deleted, which means i have to log in via SSH to recreate them manualy on each server.

1. Is there a way to prevent that symlink in "/vmimages" from being deleted by updates ?

2. If not can i automate the creation of the symlink after updates?

Thank you.

Reply
0 Kudos
1 Reply
MG_SYM
Contributor
Contributor

So far this is what i implemented may be it will be useful for others (not tested with an upgrade or patching yet)

Add the below script to "/etc/rc.local.d/local.sh" to run during boot (ESXi 5.1)

# Create ISOs symlink if deleted by update

SymLink='/vmimages/ISOs'

Destination='/vmfs/volumes/datastore_3/vmimages'

Name='ISOs'

if [ ! -L $SymLink ]

  then

   ln -s $Destination $Name

fi

#-------------------

Reply
0 Kudos