Help Automation reset of vm?

itdaddyitdaddy Senior MemberMember Posts: 2,089 ■■■■□□□□□□
hey guys,
Okay this is my issue. We have an exchange server vm that doesn't play well with our backup system. S

So for now until we get the new Exchange server, i want to reset the vm every so often on schedule...so how in the heck do I do that in command line? Does it have cron? and can you lead me to commands and steps to do that thanks guys
icon_cheers.gif

Comments

  • dave330idave330i Member Posts: 2,091 ■■■■■■■■■■
    Use scheduled task in vCenter.
    2018 Certification Goals: Maybe VMware Sales Cert
    "Simplify, then add lightness" -Colin Chapman
  • elToritoelTorito Member Posts: 102
    Alternatively, simply create a batch file on the Exchange server itself ("shutdown -r -t 0") and have a scheduled task on the server run it on occasion. Sure, you wouldn't be able to manage the task from vCenter, but then again, the task will always work, even when vCenter becomes unavailable for any reason.
    WIP: CISSP, MCSE Server Infrastructure
    Casual reading: CCNP, Windows Sysinternals Administrator's Reference, Network Warrior


  • itdaddyitdaddy Senior Member Member Posts: 2,089 ■■■■□□□□□□
    I can makes scripts but the vm needs to be reset it hangs and rebooting from within doesn' work...I need a cron time scheduled task to RESET it it is fast and effective for temp time speak until I budget the money and have the time for the conversion..just need the command cli code to schedule it via command line ..thanks
  • jibbajabbajibbajabba Member Posts: 4,317 ■■■■■■■■□□
    What version of ESX and have you got PowerCLI available ?
    My own knowledge base made public: http://open902.com :p
  • meadITmeadIT Member Posts: 581 ■■■■□□□□□□
    If it's hanging and not responding to anything, I'm assuming that the VMware tools would not be sending heartbeats to the host. If that's the case, and assuming you're running at least Essentials Plus licensing, you could enable VM monitoring in the HA configuration. It will reset the VM when the heartbeat stops and it sees no network or storage I/O coming from the VM. This way you wouldn't have to wait until a scheduled time for it to reboot, it will be monitored and reset once the above criteria are met.

    Edit: As dave also said, it can be scheduled using Scheduled Tasks in vCenter. Go to the vCenter home page --> Scheduled Tasks --> New Scheduled Task, select "Change the VM power state" and you have the option to reset.
    CERTS: VCDX #110 / VCAP-DCA #500 (v5 & 4) / VCAP-DCD #10(v5 & 4) / VCP 5 & 4 / EMCISA / MCSE 2003 / MCTS: Vista / CCNA / CCENT / Security+ / Network+ / Project+ / CIW Database Design Specialist, Professional, Associate
  • ZartanasaurusZartanasaurus Member Posts: 2,008 ■■■■■■■■□□
    I'm more curious about why the Exchange server locks up because of a backup job.
    Currently reading:
    IPSec VPN Design 44%
    Mastering VMWare vSphere 5​ 42.8%
  • blargoeblargoe Self-Described Huguenot NC, USAMember Posts: 4,174 ■■■■■■■■■□
    I'm more curious about why the Exchange server locks up because of a backup job.

    Yeah, me too...
    IT guy since 12/00

    Recent: 11/2019 - RHCSA (RHEL 7); 2/2019 - Updated VCP to 6.5 (just a few days before VMware discontinued the re-cert policy...)
    Working on: RHCE/Ansible
    Future: Probably continued Red Hat Immersion, Possibly VCAP Design, or maybe a completely different path. Depends on job demands...
  • itdaddyitdaddy Senior Member Member Posts: 2,089 ■■■■□□□□□□
    Unitrends uses VSS and when it releases the database it locks up something to do with not closing properly after vs shadow copy..and I have to move to 2010 exchange for it to work..

    Crond sucks in vmware. so I finally remembered kiwi cat tools Cat tools rocks I run a shell ssh session
    and then I excute a batch file command like this bam it is done on schedule...

    vim-cmd vmsvc/power.reset 112 it is a esxi 4.1 and cron sucks due to it don't work and hardly any CLI documention..there is so many cron types it is mind boggling why could they just make it be universal nope to easy...dissappointing...i read up on cron everywhere tried everything and decided to use cat tools
    bam first tried work omg yikes!!
Sign In or Register to comment.