Power off / power on the script

I have upcoming maintenance windows and I want to see if it is possbile to this script...

I would like to stop all powered from the virtual computer in a cluster. If the VM tools are not installed, turn off the virtual machine.

In a second script, turn on all the VMS that have closed or off the previous script. I don't want power on all virtual machines, that those who worked before. I join the only power over 10 virtual machines at once every 5 minutes (in order to avoid a quarrel of storm and start resources).

-James

For the 2nd script, we use the .csv 1 script file.

This give a try.

$start = Get-Date
$names = Import-Csv "C:\Temp\cluster-vm-stopped.csv"
$total = 0
while($total -le $names.Count){
  1..10 | %{
    if($names[$total]){
      Start-VM -VM (Get-VM -Name $names[$total]) -Confirm:$false -RunAsync
      $total++
    }
  }
  while((Get-Date - $start).TotalMinutes -lt 5){
    sleep 10
  }
  $start = Get-Date
}

____________

Blog: LucD notes

Twitter: lucd22

Tags: VMware

Similar Questions

  • After a minute to the power of the battery turns off my Satellite 1400

    Hello! I need your help! Whenever I go to the power of the battery, all of a sudden, a minute later, my laptop turns off without reason! The battery is fully charged. What do you think is the problem? My laptop is 4 years old.
    It is a Satellite 1400.
    Thank you very much!

    Hi Krissy

    In my opinion, everything that happens has a reason any. From your description, I think that the battery is at the end and should be replaced.

    It may be that the battery is full, but there is not enough power. I have a similar problem with Tecra 9000. Unit is also about 4 years. On battery it maybe rolls 10 minutes but after that this time he switched down suddenly.

  • Satellite L755 - suddenly then turn off blinking of power and the battery LEDs

    In recent weeks, when using the laptop (Satellite L755 psk2ye) he died suddenly and the power and the battery leds start flashing simultaneously.

    It also takes place when charging the battery when the unit is off... then l must cut off the power and he'll be back... Although the problem sometimes occurs again after a few minutes hours or does not...

    Remove the battery and check if the same problem occur when you use laptops with power running.

    Please post comments.

  • How to detect the screen off the power of the event

    Is it possible to detect the screen off the power of the event?  I am looking to detect when the screen turns off due to time-out or press the button of the lock screen.  Similarly, I would need to detect where the screen turns back on.  I searched through the API WebWorks and forums but have not found anything relevant.  Maybe I'm looking just the wrong thing. Any help would be appreciated.

    Hi deedubbu,

    I'm certainly not an Expert in Java BB so it might be a good idea to post something on these forums, but a quick search on Google, it seems that you should be able to encapsulate event

    In Exchange for my Google search, I humbly request post you the result on our community API github repo

  • all in a single j6480 won't turn on or off by pressing the power button

    my all in one j6480 won't turn on or off by pressing the power button. from pluging in the power cable to the output, the display panel stays on by a flashing point moving from left to right, repeatedly. also, there is a faded beeps coming from the printer on the left side. See no empty self am unable to do anything on this subject.

    There may be a problem with the power supply/power cord module brick.  Try following the steps described in this document.  If that does not receive the printer works properly again, you can try to contact tech support to buy a new power module (if still available), or you need to replace the printer.  You can join the 1-800-474-6836 technical support to the United States and the Canada International users click here.  Let me know what happens.

  • HP DV6-6B25TX turn off after 10 to 15 seconds, regardless of the power of the battery or power supply

    Hello

    MY DV6-6B25TX is cutting off after 10-15 seconds, regardless of the battery power or AC power.

    Here's the complete scenario of what happened in recent weeks:--

    Two weeks back I was using the laptop with the power adapter is plugged in for charging, the battery got charged up to 99% then it stopped charging and display the battery icon text, "plugged in, not charging".

    A return of the week, the battery was 20%, after plugging in the charger, always the same message "Plugged in, no charging current".

    Now the laptop does not meet the key power when the battery is inserted.

    If I remove the battery and back again, it starts without pushing the power button and turns off after 10 seconds, well before Windows starts.

    She stops even on the Bios screen, OS is not definitely the question.

    When I plug in charger and press the power button / stop, the same thing, i.e. starts and shutts off after 10 to 15 seconds, regardless of the BIOS or Windows startup screen.

    I removed the ram and but again, but the problem still persists.

    Also there is no issue of overheating due to dust, as I've barely used the laptop for a few hours, the phone is about 6 months and under warranty.

    Please advice ASAP.

    Thanks in advance.

    Honestly, something prevents the battery charge. Computer laptop closing seconds after that reinsert the battery is a good indication the battery just is not getting charged. This could be a battery failure, charger, port, or in rare cases of charge motherboard.

    Since it's under warranty, I recommend you contact HP support that there is no easy solution for this on the forums. It's a hardware problem.

    The number of the Canada and the United States support is 1-800-474-6836.

  • Error! The CPU was displayed by the operating system of Fords. Power off or reset the virtual machine

    Why when I try install Mac Os Yosemite in VMwareplayer when the virtual machine starts, I get this error:

    The CPU was displayed by the operating system of Fords. Power off or reset the virtual machine

    I have an AMD A10 processor

    VMware does not support the operation of Mac OS X in VMware Player/workstation!  Also, legally virtualisables versions of OS X running in a Virtual Machine can be done when done in the Apple brand hardware but when done while running under OS X, and for that, you need VMware Fusion not VMware Player/Workstation (or use ESX/ESXi on Apple brand hardware) you violate Apple's SLA for this product.  So any help can you provided for OS X in this use of the scenarios that it would violate the community VMware operating conditions to do.

  • Help. The CPU has been disabled by the guest operating system. Power off or reset the virtual machine. WHY?

    Greetings.

    I have a 5.5 with an operating system Red Hat 5.10 ESXi environment. The OS worked fine until a few days ago. ESXi displays the error "the CPU has been disabled by the guest operating system. Power off or reset the virtual machine. I Don t know why my server displays the error if my environment was OK. Could be a kernel problem? operating system problem?

    Ideas?

    Thanks for the help.

    Have a look here. http://KB.VMware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalID=2000542

    Did you recently patch your VM? Looks like when the guest operating system runs the incorrect commands that it can have a deactivated processor.

  • All virtual machines on my ESX host off power at the same time

    Hi all

    Recently I attend the interview. a guy asked me this question

    < police = "Times New Roman, serif" >all virtual machines on my power off ESX at the same time host < / police >< / police >?

    What was the cause of the highest of the error, how to troubleshoot the error.please me.anybody guide to address this problem?

    Thanks

    Surya

    If all the virtual machines if lower at the same time, my bet would be VMware HA. Just for fun, build it inside your head:

    (1) 8 ESX nodes, all service consoles connected to a unique management switch.

    (2) now to create a cluster of these nodes, put all your virtual machines in there and activate HA, choose ' host isolation response: power off.

    (3) draw power from your management switch. HA on each host will deduct that the host is isolated-> turn off all the virtual machines.

    Each host will think the same thing, and hop find you with all virtual machines down to the time in the whole of the cluster. Have seen this one several times when people go and upgrade their management switches in the evening ("hey, it's only management").

    Visit my blog at http://www.vmdamentals.com

  • When you run the script via VMware tools when power changed, some commands in script (as a copy) has failed.

    I came across a very strange question. I tried to create some custom vmware scripting tools, such as a new .bat file. This file contains a large number of orders, mostly as copy command "copy file://\\192.168.172.5\abc.exe c:\. ». I set this file as a custom script for Script event - power on guest operating system. Everything goes well with the bat file when I tested it. But after that I changed the State of power to power on, all other commands work fine except the copy commands in the bat file. Why? How can I make it work? Of course the problem of network. And that makes me very confused.

    Hello

    First copy the files on local disk was OK.

    If this works for local disk, but not to a network drive, then hit you indeed a permissions issue any.

    But if I run the script with tools VMware service script, the commands of copy (of the remote shared folder) failed while other controls worked well. I'm quite confused.

    In fact, it is easily explained. The VMware tools service (Yes, it's a service) runs under the account Local system and by default, the local system account has no access to the network for security reasons. You can change the user of the service runs under and see if that solves your problem (very likely)

    To do this, go to computer management (right-click icon desktop, select 'Manage') and open Services and Applications, service page, locate the VMware Tools service in the list. Select properties, log on to the page tabs and change account at your own Local System account. Restart the service and it should work.

    --

    Wil

    _____________________________________________________

    Visit the new VMware developers at http://www.vi-toolkit.com wiki

  • My Mac Pro is not turn on; There is power at the output, light or sound when I push the button 'on '. Any suggestions? Thank you

    My Mac Pro is not turn on; There is power at the output, light or sound when I push the button 'on '. Any suggestions? Thank you

    It was AC off recently?

  • Power on the Satellite Pro 3000 problem

    Wives Satellite S3000 has developed what appears to be a power problem

    Last night it started indicating that he doesn't have the power of the DC input... This seemed to be a fault of internittent stirring casued DC input light to return cable. Taking the DC Jack off main cable, I discovered that one of the two pins was broken.

    Is out today and bought a new 5.5mm/2.5mm DC Jack and reconnected thinking that everything would be OK... but there is no response from the laptop... the DC input light does not come on and neither does the indicator "charging battery".

    A multimeter indicates there is 19v DC decision-making.

    It seems to me that there may be an internal power problem. Otherwise there may be a problem with the power with respect to the current delivery.

    A battery totally buggered may this "non-response"? I expect the laptop to operate on DC power regardless of the internal State and secondary battery.

    Ideas appreciated... will see if I can alternative power source and try it before resorting to delve into the bowels of the thing!

    Thank you

    Hello

    > A battery totally buggered may this "non-response"? I expect the laptop to operate on DC power regardless of the internal State and secondary battery.

    The laptop should run without battery. If the adapter is ok and if it was connected to the laptop, then it should be possible to start the machine.

    If the laptop does not start, then it must be a hardware problem.
    But believe me; It's not easy to say what exactly is the problem.

    Maybe you bought only a bad power adapter that is not compatible with the Sat Pro 3000?
    Or maybe there is something wrong with the electronic power supply on the motherboard?
    Who knows?  :| Only the technician who checked the laptop can provide an exact error diagnostic.

  • Tecra 9100 does not supply power to the top

    Hello

    I got Tecra 9100 laptop computer and you have a POWER PROBLEM.
    Basically, it got stuck at the start of the OS and I was unable to click or move the mouse to do something. So I held the power button to turn it off. I do not turn on again entered game coz I had to go somewhere.

    So when I tried to move THE next day and he won't power upward. I can see a GREEN LIGHT but can not hear any CPU, the FAN, the monitor or the hard sound. When I connect to the AC adapter, I can see the LOAD LED but nothing else seems to be powered.

    I also tried to replace the memory Module, but still won't power upward. I guess that the motherboard does not have to be ABLE so nothing is turned. But the one thing that I do not understand why the POWER LED on (GREEN LED) is on, unless it has the power source.

    Can someone tell me what I need to do?
    Help, please

    Thank you

    Hi Sonia,.

    I suggest that you try to remove the battery and power supply so that all power of the laptop is turned off. Reconnect AC power and try to turn on the laptop. If it works, then re-install the battery. I think that the electronics of power sometimes get "stuck" and this procedure usually receives smooth them.

    If the unit still does not power on after having tried the above procedure, then I suuspect there must be a problem of internal material in which case you must take the device to a partner of Service authorized for rectification.

    Kind regards

  • Satellite A85-s107 - white screen at startup by using the power of the battery

    Satellite A85-s107 white screen at startup by using the power of the battery

    When I boot A85-s107 in battery power, it is get booted up in the background, but my screen is empty.
    After that if I connect it to AC power and switch deactivation/activation of the laptop power button, the screen comes back to life.

    There is no problem when I start upward when it is connected to an electrical outlet.
    Battery is fully charged and computer will work off the battery voltage if I remove AC after boootup

    Any suggestions?

    PS:

    also note that when I remove AC and then reconnect I start the computer on two occasions that it does not start the 1st time?

    Don t need to recharge the battery if the AC adapter is plugged ;)
    Try the tips posted by Alex otherwise it of a hardware problem, in my view, there seems to be something wrong with the motherboard...
    In this case, only the replacement could help and it could be a costly affair

  • Satellite Pro 440 CDT does not supply power to the top

    Hi, I have an old 440 CDT which does not supply power to the top. Someone at - it ideas?
    AC is connected, the power led is lit, green. Battery is dead (as in buried). When I press the power button, the following occurs:
    -The led is green
    -Num lock (the one with the 'A' on this subject) flashes 3 times: long-short-short
    -HARD drive flashes 1 time, green
    -CD light flashes 1 time, orange
    -Popping sound in the speakers
    Then it turns off again, with the power light green constantly led.

    Nothing happens on the screen (I tried FN + F5). I'm also past CD/diskette, attached, with or without battery, without help.
    I am confused, please help!

    THX, Eric

    Hello Eric

    As you know, on this way it is not possible to give an accurate diagnosis, just speculate what may be the problem. In my opinion it is certainly because of faulty electronics on board, but what, exactly, it is not easy to say. Try to contact someone who has experience with laptop repair procedure.

Maybe you are looking for

  • Tecra M2 - DVD/CD drive does not read

    I have a Tecra M2 with the DVD Rom/CD burner. When a disc is inserted, it runs but does not read - light stays on. After a few eject and reinsert the cycles he usually manages to play the disc. Long the standing problem which affects different DVD an

  • An album will not transfer from iPhone to iTunes.

    I recently got a new Macbook Pro, and I synced all my music to iTunes. All other music synchronized outside an album. When I search this album in the store he tells me that I have to pay and not just download showing she believes that I have already

  • closing the window BACK to exec system

    Hi, I used the exec.vi system to run a program, wait for the program to end and then run it again with slightly different input parameters. This occurred hundreds of times and works OK except sometimes the program crashes and the DOS window is just s

  • drivers for Acer 5750Z

    As I installed Windows 10 I get WiFi dropouts, several times a day. I use the convenience store, he finds the problem and fix it. The problem is with the network card. This can happen several times a day or session. I read that it could be the driver

  • App Walkman search works do not properly after the update of the lollipop?

    Anyone else have problems with search app walkman? Yesterday it worked fine until I updated to the lollipop, when I wanted a song that she really was. Now he broke everything and can usually find the results only when I type in two or three letters.