VMware Cloud Community
norbusherpa
Contributor
Contributor

Scheduling the script to restore the snapshot and power on multiple virtual machines

Im planning to revert 10 VMs one by one in ESXI 6 by executing shell script in ESXI crontab here '/var/spool/cron/crontabs/root' at midnight '0 12 * * * /opt/revert_script.sh' . The content of revert_script.sh are like below:-

#!/bin/sh
/bin/vim-cmd vmsvc/snapshot.revert 10 2 0 && /bin/vim-cmd vmsvc/power.on 10

/bin/vim-cmd vmsvc/snapshot.revert 11 2 0 && /bin/vim-cmd vmsvc/power.on 11

/bin/vim-cmd vmsvc/snapshot.revert 12 2 0 && /bin/vim-cmd vmsvc/power.on 112

These option were not selected when i took the snapshot Snapshot virtualmachines memory , Quiesce guest file system

Im trying to schedule this using scripts because these are the demo systems for student use and they need to be in working state the next day.

Is this right and safe approach to revert the virtualmachines   ? I'm worried if the snapshot will get corrupted

Reply
0 Kudos
2 Replies
daphnissov
Immortal
Immortal

It would be far better/safer for you to do so through vCenter and let it control that process than going directly to the ESXi host. Do you have vCenter?

Reply
0 Kudos
norbusherpa
Contributor
Contributor

.
Reply
0 Kudos