Announcement

Collapse
No announcement yet.

VMWare Stop/Start Script...

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • VMWare Stop/Start Script...

    question regarding the start/stop script.


    will this batch work if i have my VM's located on a different partition but vmware installed to the default




    C:
    cd "\Program Files\VMWare\VMware Server"
    call vmware-cmd "D:\Virtual Machines\Server1.vmx" stop
    call vmware-cmd "E:\Virtual Machines\Server2.vmx" stop
    cd \

    or do i need to add a "cd" anywhere in order for it to know it's not on the same partition?

    thanks.

  • #2
    Re: VMWare Stop/Start Script...

    i dunno. try it and find out. i mean, they are virtuals... disable the NICs if there are duplicate names on your physical net and give it a shot. the worst thing that could happen is nothing...

    if it does work, post the results so that others may learn from your experience. if it doesnt, post it as well...


    j
    its easier to beg forgiveness than ask permission.
    Give karma where karma is due...

    Comment


    • #3
      Re: VMWare Stop/Start Script...

      Originally posted by MMF View Post
      question regarding the start/stop script.


      will this batch work if i have my VM's located on a different partition but vmware installed to the default




      C:
      cd "\Program Files\VMWare\VMware Server"
      call vmware-cmd "D:\Virtual Machines\Server1.vmx" stop
      call vmware-cmd "E:\Virtual Machines\Server2.vmx" stop
      cd \

      or do i need to add a "cd" anywhere in order for it to know it's not on the same partition?

      thanks.
      The syntax for vmware-cmd is vmware-cmd <path to .vmx file> <what you want to do>

      Your script will work as is assuming the paths are correct, however, you've made your script overly complicated. I can do in 2 lines what you've scripted in 5. Here's my version of your script:

      call "C:\Program Files\VMWare\VMware Server\vmware-cmd" "D:\Virtual Machines\Server1.vmx" stop trysoft hard
      call "C:\Program Files\VMWare\VMware Server\vmware-cmd" "E:\Virtual Machines\Server2.vmx" stop trysoft hard

      Notice I added trysoft hard to your stop command. Best practice there to gracefully shutdown your guest VM and if that fails, then pull the plug on it.

      Jas
      VCDX3 #34, VCDX4, VCDX5, VCAP4-DCA #14, VCAP4-DCD #35, VCAP5-DCD, VCPx4, vEXPERTx4, MCSEx3, MCSAx2, MCP, CCAx2, A+
      boche.net - VMware Virtualization Evangelist
      My advice has no warranties. Follow at your own risk.

      Comment

      Working...
      X