Start a virtual machine only if the other VM is powered off

Hello

I am looking for a way to start a specific VM only if a specific other VM is powered off.
I tried to create a simple script for that, but it did not work.

For me, it should be something like getting the power state of the VM1, if that is turned off, then he must start VM2

Is this possible?

Kind regards.

Do you mean something like this?

if((Get-VM -Name vm1).PowerState -eq "PoweredOn" -and (Get-VM -Name vm2).PowerState -eq "PoweredOff"){
  Get-VM vm2 | Start-VM -Confirm:$false}

Tags: VMware

Similar Questions

  • Cannot add to the inventory if virtual machine running on the other guests - iSCSI and VMFS5

    5.5 ESXi hosts free standalone version

    iSCSI mounts with multiple paths - relatively new unit with more modern hardware

    CHAP not used

    I'm running a few hosts in order to climb the same iSCSI data stores. The iSCSI LUN is visible and editable by all hosts. If Host1 is to map the iSCSI LUN (VMFS5) and a VM is powered, Host2 can add that VM to the inventory. It's possible with NFS iSCSI for a reason any. This is for a specific reason? Only when I turned off the virtual computer can I add it to both hosts. Other that just lock files are placed in the directory, I missed something related to the lock?

    From now on, adding new esxi hosts does not allow me to add existing virtual machine, less than the voltage first. Once again, NFS does, iSCSI, this isn't. Any ideas?

    It is not specific to ISCSI but rather to the use of VMFS. NFS has no awareness VM VMFS is and why it is not possible to do that with iSCSI / VMFS. There is a lock on the disk for each virtual machine of (race), and that's why the second host is not able to add this host to its inventory. With vSphere HA, this lock is released when a failover should occur.

  • list published on the virtual machine only in the script

    In view of the part of the script that I have below, y at - it a way to edit the "VMs Num" be fed only on virtual machines, I'm not sure what to add to the end of $ESXHost.vm.count

    Thanks, Dan

    $Report = @)

    $ESXHosts = get-VMHost | Sort name | Get-View

    ForEach ($ESXHost to $ESXHosts)

    {

    $ReportObj = "" | Select the name, 'Active VMotion', 'Connection status', 'CPU used (MHz)","Total CPU (MHz)","% CPU used, 'RAM used (GB)', ' Total RAM (GB) ', '% RAM used', 'Num of virtual machines.

    $ReportObj.Name = $ESXHost.Name

    $ReportObj. "" VMotion enabled "= $ESXHost.summary.config.vmotionenabled

    $ReportObj. "" Connection status "= $ESXHost.summary.runtime.connectionstate

    $ReportObj. "" CPU (MHz) ' = $ESXHost.summary.quickStats.overallCpuUsage

    $ReportObj. "' Total of CPU (MHz)" = (($ESXHost.summary.hardware.NumCpuCores) *($ESXHost.summary.hardware.CpuMhz))

    $ReportObj. "" CPU % used ' = '{0:F1}' f (100(($ESXHost.summary.quickStats.overallCpuUsage)/(($ESXHost.summary.hardware.NumCpuCores)($ESXHost.summary.hardware.CpuMhz)))

    $ReportObj. "" RAM used (GB) "=""($ESXHost.summary.quickStats.overallMemoryUsage/1024)-f"

    $ReportObj. "" Total RAM (GB) "=""($ESXHost.Summary.Hardware.MemorySize/1GB)-f"

    $ReportObj. (("" % Of RAM used "=""(100*(($ESXHost.summary.quickStats.overallMemoryUsage/1024)/($ESXHost.Summary.Hardware.MemorySize/1GB) f))

    $ReportObj. "" NB of VMs ' = $ESXHost.vm.count

    $Report += $ReportObj

    }

    $Report | ConvertTo-Html-of title 'Advanced Host' - body "& lt; H4 & gt; Advanced Host Information & lt; / H4 & gt; » | Out-file - add $filelocation

    Allan nice solution, but I think it should say

    $ReportObj."Num of VMs" = (Get-vmhost $ESXHost.name | get-vm | where {$_.Powerstate -eq "PoweredON"} | Measure-Object).Count
    
  • What HA refusing to try to start a virtual machine?

    I'm trying just to clear on how this process works. If HA is enabled, there is a failure of the host, and he's trying to restart the virtual machines on one or several other hosts, when the host will refuse to restart (failover) a virtual machine? Assume that there is no reservation other than the default 37 MHz CPU and some booking fees calculated generals for RAM (these are the default values, right?). A host would continue to attempt to restart the virtual machines as long as there are at least 37 Mhz and a few hundred MB of RAM available for the moment he is trying to restart? And if so, there are algorithms maintains the host master to decide where to start these VMs? I just think that she should try to startups VM alternately between the available hosts and wait a little bit to make sure that there are still some available resources before you start the following, or something like that.

    Also, if there is fragmentation of resources (for example, 8% of availability on each of the 15 hosts), but HA needs to start a virtual machine that requires 15% of host resources (I realize that there is a reserve in order to decide this question of the requirement, even), would automatically make migration of VMS to other hosts (if the DRS is also enabled) or he'd just sorry cannot start this virtual machine, even if the group as a whole has space for him.  [in this case, must not make large reserves because without a reservation, the virtual machine would start upward and like CPU or memory has increased its use would cause some DRS force other virtual machines out of the host, and perhaps that would work.]

    vSphere 5.1 (vCenter and ESXi)

    The master knows where virtual machines are running and try to balance where virtual machines are started. Reservations and overhead costs are the only things taken into account from a point of view of its use (not the actual resources consumed on a host) because HA does what VMs restarted (and if they have reserves prompting these resources, they need to have to start).

    If the DRS is turned on and available, HA will work with DRS to move workloads so that the largest VMs can begin. If you have virtual machines more the thing to think about is what admission control policy you use. It may be wise to use the location function if all your virtual machines are large and close to the same size, or dedicated host of failover so you won't have to deal with shuffling DRS of workloads. Everything depends on your environment and your needs.

    Does that answer your questions?

  • Start the virtual machine based on the load of another virtual machine

    Hi all

    I am looking for a solution that will start the VM on request depending on the load on the other virtual machines, perhaps in the same resource pool. Essentially, the expected result would be something like this:

    -When the dv01 reaches 75% CPU usage for 15 minutes,

    -Boot VM02

    -Once dv01 was less 40% use for 30 minutes,

    -Close the VM02

    This could also be a new virtual machine that is upwards of a model and Sysprep, rather than one that just sits there, offshore and unused.

    I hope that the final objective is clear. Does anyone have recommendations on how to do it? I just did a quick search on certain clauses that I thought would be relevant and did not really turn anything upwards.

    Thanks for your comments!

    -James

    jamesgreen wrote:

    Hi all

    I am looking for a solution that will start the VM on request depending on the load on the other virtual machines, perhaps in the same resource pool. Essentially, the expected result would be something like this:

    -When the dv01 reaches 75% CPU usage for 15 minutes,

    -Boot VM02

    -Once dv01 was less 40% use for 30 minutes,

    -Close the VM02

    This could also be a new virtual machine that is upwards of a model and Sysprep, rather than one that just sits there, offshore and unused.

    I hope that the final objective is clear. Does anyone have recommendations on how to do it? I just did a quick search on certain clauses that I thought would be relevant and did not really turn anything upwards.

    Thanks for your comments!

    -James

    with raise vm02, you can set the alarm action to run a script that will start vm02.

    PowerCLI command would be

    Start-VM - vm VM02

    you could probably add an alarm if dv01 has a less than 40% cpu

    run another script

    the command is:

    stop-vmguest - vm-VM02

  • Start a virtual machine in offline mode? (i.e. If it is not on the network)

    I want to be able to start a virtual machine and modify network settings before I allow it to connect to the network.  The physical equivalent of this would be to pull the cable network on a server before starting, then the changes after startup and then plug the cable back in.

    Is there some equivalent to this in VMWare?  Can someone suggest a procedure for this?

    Go to the virtual machine settings and uncheck the box "connect to power on" for the network card.

  • VI Client shows 95% starting a virtual machine but the virtual machine is already up

    VI Client shows 95% starting a virtual machine but the virtual machine is already running and so for a few days. E customer VI is not refreshing or the management console should be cycled/restarted?

    ESXi, correct?

    See this link

    http://www.VM-help.com/ESX/esx3i/ESXi_restart_agents.php

  • How to start a virtual machine without vmx file

    Hello, I have a virtual machine that I want to start up using 10.0.0 on Ubuntu 14.04 32-bit workstation but I don't have multiple vmdk files and a file on me vmxf and apparently, that's all that is in the software. How do I run something like that?

    Hello
    You cannot start a virtual machine without a vmx file.
    If you do not have a vmx file - fly a.
    For example this one:
    -----------------------------------

    . Encoding = "windows-1252".

    config.version = '8 '.

    virtualHW.version = '8 '.

    scsi0. Present = 'TRUE '.

    scsi0.virtualDev = "free".

    memsize = "2048".

    scsi0:0. Present = 'false '.

    scsi0:0. FileName = "set-path-to-bootdisk-and-then-set-.present-to-true-to-activate".

    ethernet0. Present = 'TRUE '.

    ethernet0.virtualDev = "e1000".

    displayName = "minimal-vm.

    guestOS = "windows7-64.

    virtualHW.productCompatibility = "hosted".

    ------------------------------------

    That cuts into a file and store it as a *.vmx.
    Then launch the new VM with
    VMware /path-to-vmx/name.vmx or
    vmplayer /path-to-vmx/name.vmx
    Other users may also recommend to simply launch the user interface and follow the file > New menu...
    and then order the new virtual machine to the card by selecting your existing virtual disks.

  • [Q] cannot start a virtual machine - internal error [SOLVED]

    Hallo,

    I installed Workstation 8 and cannot start a virtual machine - or those created those previous or new. Turn the machine gives me an "internal error."

    My characteristics: Win 7 64-bit (SP1), Core i7 2600 K with 8 GB of Ram

    The newspaper of vmware:

    011 10 - 03 T 19: 22:38.013 + 02:00 | VMX | I120: Log for VMware Workstation pid = 3424 version 8.0.0 = Build = build-471780 option = output
    2011-10 - 03T 19: 22:38.013 + 02:00 | VMX | I120: The process is 64-bit.
    2011-10 - 03T 19: 22:38.013 + 02:00 | VMX | I120: Host = encoding windows-1252 = windows-1252 codepage
    2011-10 - 03T 19: 22:38.013 + 02:00 | VMX | I120: Host is Windows 7 Home Premium, 64-bit Service Pack 1 (Build 7601)
    2011-10 - 03T 19: 22:37.713 + 02:00 | VMX | I120: VTHREAD initialize main thread id 0 "vmx" host 6336
    2011-10 - 03T 19: 22:37.738 + 02:00 | VMX | I120: Settings REGIONAL windows-1252-> user NULL = System = c07 c07
    2011-10 - 03T 19: 22:37.738 + 02:00 | VMX | I120: Msg_SetLocaleEx: HostLocale = windows-1252 UserLocale = NULL
    2011-10 - 03T 19: 22:37.743 + 02:00 | VMX | I120: FILE: FileLockDynaLink: other process validation tools are: available
    2011-10 - 03T 19: 22:38.014 + 02:00 | VMX | I120: Hostname = KOENIG
    2011-10 - 03T 19: 22:38.017 + 02:00 | VMX | I120: IP = d fe80::41: e6a3:5dd2:fa9f % 11
    2011-10 - 03T 19: 22:38.017 + 02:00 | VMX | I120: IP = fe80::1cf:3682:36e8:4ccb % 17
    2011-10 - 03T 19: 22:38.017 + 02:00 | VMX | I120: IP = fe80::1 d 80: 2f6e:979 c: b57d 18%
    2011-10 - 03T 19: 22:38.017 + 02:00 | VMX | I120: IP 192.168.1.4 =
    2011-10 - 03T 19: 22:38.017 + 02:00 | VMX | I120: IP = 192.168.30.1
    2011-10 - 03T 19: 22:38.017 + 02:00 | VMX | I120: IP = 192.168.158.1
    2011-10 - 03T 19: 22:38.017 + 02:00 | VMX | I120: HOSTINFO 1074415970 @ 3331240Hz-> 0 Hz 1000000000
    2011-10 - 03T 19: 22:38.017 + 02:00 | VMX | I120: HOSTINFO ((x * 2518163806) > > 23) + 322527338056
    2011-10 - 03T 19: 22:38.037 + 02:00 | VMX | I120: System uptime 321912074 us
    2011-10 - 03T 19: 22:38.037 + 02:00 | VMX | I120: command line: "C:\Program Files (x 86) \VMware\VMware" "-s" 'vmx.stdio.keep = TRUE' "-#" "product = 1; name = VMware Workstation; version 8.0.0 =; BuildNumber = 471780; licensename = VMware Workstation; licenseversion = + 8.0; ""-@ ""pipe=\\.\pipe\vmxf3ce37cf9b6f9c3e;" "D:\VM\Windows 7 x64\Windows 7 x64.vmx".
    2011-10 - 03T 19: 22:38.037 + 02:00 | VMX | I120: Msg_SetLocaleEx: HostLocale = windows-1252 UserLocale = NULL
    2011-10 - 03T 19: 22:38.056 + 02:00 | VMX | "I120: UI connection on pipes '\\.\pipe\vmxf3ce37cf9b6f9c3e' user (null)".
    2011-10 - 03T 19: 22:38.057 + 02:00 | VMX | I120: VMXVmdb: local connection timeout: 60000 ms.
    2011-10 - 03T 19: 22:38.104 + 02:00 | VMX | I120: VmdbAddConnection: cnxPath = / db/connection / #1 /, cnxIx = 1
    2011-10 - 03T 19: 22:38.105 + 02:00 | VMX | I120: Vix: [6336 mainDispatch.c:483]: VMAutomation: initialize VMAutomation.
    2011-10 - 03T 19: 22:38.105 + 02:00 | VMX | I120: Vix: [6336 mainDispatch.c:780]: VMAutomationOpenListenerSocket() to listen
    2011-10 - 03T 19: 22:38.122 + 02:00 | VMX | I120: Vix: [6336 mainDispatch.c:4067]: VMAutomation_ReportPowerOpFinished: VarEtat = 0, newAppState = 1870, success = 1 additionalError = 0
    2011-10 - 03T 19: 22:38.122 + 02:00 | VMX | I120: Past vmx/execState/val of poweredOff
    2011-10 - 03T 19: 22:38.122 + 02:00 | VMX | I120: Vix: [6336 mainDispatch.c:4067]: VMAutomation_ReportPowerOpFinished: VarEtat = 1, newAppState = 1873, success = 1 additionalError = 0
    2011-10 - 03T 19: 22:38.122 + 02:00 | VMX | I120: Vix: [6336 mainDispatch.c:4067]: VMAutomation_ReportPowerOpFinished: VarEtat = 2, newAppState = 1877, success = 1 additionalError = 0
    2011-10 - 03T 19: 22:38.122 + 02:00 | VMX | I120: Vix: [6336 mainDispatch.c:4067]: VMAutomation_ReportPowerOpFinished: VarEtat = 3, newAppState = 1881, success = 1 additionalError = 0
    2011-10 - 03T 19: 22:38.122 + 02:00 | VMX | I120: VMMon_GetkHzEstimate: calculated 3411189 kHz
    2011-10 - 03T 19: 22:38.123 + 02:00 | VMX | I120: VMMon_RememberkHzEstimate: calculated 3411189 kHz
    2011-10 - 03T 19: 22:38.123 + 02:00 | VMX | I120: TSC kHz estimates: Memoirs of vmmon 3411189, 3411189, osReported 3401000. With the help of 3411189 kHz.
    2011-10 - 03T 19: 22:38.123 + 02:00 | VMX | I120: CPU 0 # TSC = 1100186590922
    2011-10 - 03T 19: 22:38.123 + 02:00 | VMX | I120: CPU # 1 TSC = 1100186590888
    2011-10 - 03T 19: 22:38.123 + 02:00 | VMX | I120: # 2 CPU TSC = 1100186590603
    2011-10 - 03T 19: 22:38.123 + 02:00 | VMX | I120: CPU # 3 TSC = 1100186590637
    2011-10 - 03T 19: 22:38.123 + 02:00 | VMX | I120: CPU # 4 TSC = 1100186590948
    2011-10 - 03T 19: 22:38.123 + 02:00 | VMX | I120: CPU # TSC 5 = 1100186590906
    2011-10 - 03T 19: 22:38.123 + 02:00 | VMX | I120: CPU # 6 TSC = 1100186590898
    2011-10 - 03T 19: 22:38.123 + 02:00 | VMX | I120: CPU # 7 TSC = 1100186590836
    2011-10 - 03T 19: 22:38.123 + 02:00 | VMX | I120: TSC of measured first delta 345
    2011-10 - 03T 19: 22:38.123 + 02:00 | VMX | I120: TSC 387 min Delta
    2011-10 - 03T 19: 22:38.123 + 02:00 | VMX | I120: PTSC: RefClockToPTSC 0 3331240 Hz-> 0 to 3411189000 Hz
    2011-10 - 03T 19: 22:38.123 + 02:00 | VMX | I120: PTSC: RefClockToPTSC ((x * 4294966339) > > 22) +-1100565306901
    2011-10 - 03T 19: 22:38.124 + 02:00 | VMX | I120: PTSC: tscOffset-1100187618517
    2011-10 - 03T 19: 22:38.124 + 02:00 | VMX | I120: PTSC: using TSC
    2011-10 - 03T 19: 22:38.124 + 02:00 | VMX | I120: PTSC: material TSCs are synchronized.
    2011-10 - 03T 19: 22:38.124 + 02:00 | VMX | I120: PTSC: PTSC current = 289960
    2011-10 - 03T 19: 22:38.124 + 02:00 | VMX | I120: Module CPUID initialization failed.
    2011-10 - 03T 19: 22:38.124 + 02:00 | VMX | I120: Vix: [6336 mainDispatch.c:869]: VMAutomation_LateShutdown()
    2011-10 - 03T 19: 22:38.124 + 02:00 | VMX | I120: Vix: [6336 mainDispatch.c:819]: VMAutomationCloseListenerSocket. Close the socket of the receiver.
    2011-10 - 03T 19: 22:38.125 + 02:00 | VMX | I120: VMX VMDB Flushing connections
    2011-10 - 03T 19: 22:38.125 + 02:00 | VMX | "I120: VmdbDbRemoveCnx: remove Cnx Db for ' / db/connection / #1 /"
    2011-10 - 03T 19: 22:38.125 + 02:00 | VMX | I120: VmdbCnxDisconnect: Disconnect: pipe closed for pub cnx ' / db/connection / #1 /' (0)
    2011-10 - 03T 19: 22:38.129 + 02:00 | VMX | W110: Failed to initialize the virtual machine.

    I scored an error... I tried to reinstall, clean... nothing helps.

    Curiously, I can use the Player app to run all VM´s without problem...

    All solutions?

    Thanks in advance

    Marcus4Aspern

    Is - the name change "vmware.exe" with something else?

  • Connect physical hard disks to the virtual machine (and leave the data intact)

    Hello

    I'm looking to virtualize a SOHO headless server, that I use mainly for secure file storage.

    Currently, the system runs Linux installed on a small disc and has two drives 1.5 TB, used exclusively for data, in a cluster of ZFS mirroring. (I use the ZFS-fuse Linux-based application).

    I want virtualization for two reasons. One is to make administration easier and safer - avoid having to connect a keyboard and the physical monitor to the box from time to time. The other is that the machine is a bit more powerful to handle the load, and I'm hoping to make it work on other, more challenging tasks.

    Now, there is a catch. These discs are as highly important. I mean the data on them. What I need is to convert the current Linux system to a virtual machine, or re - install Linux on a virtual machine (don't like that), then connect the physical disks to the virtual machine as if they were actually connected.

    I certainly don't want to vmware touches those disks somehow.

    I've read the documentation, but I'm a noob when it comes to server virtualization and system engineering and don't quite understand if this is possible or not. These discs are not a SAN, they are physically connected to the server, I want to install vSphere on. (Of course, I'll log out when I run the setup of vSphere. But I need plug them again later, and they need to be sure that vmware will leave them alone and pass them to the virtual machine transparent.)

    Sigmoid wrote:

    Oh yes, the cluster mirrored ZFS. It is essentially a software RAID type thingie.

    http://en.Wikipedia.org/wiki/ZFS

    A material, or the point of view of virtualization, it appears two hard drives with a single huge partition on each that is not transparent to anyone, except the implementation of ZFS.

    OK, means that you can break the RAID, connect the drives to different host and configure RAID once again, right?

    Let's do it this way

    1. We will need a disc player more for VM, cause on flash, we install ESXi
    2. I will share ZFS :-), all you need to do with that before you install ESXi
    3. make the BACKUP!
    4. Disconnect the data host drives
    5. install ESXi 4.1 U1 free version on flash
    6. Download the site VMware vSphere client
    7. Connect the VM disk to ESXi
    8. customer help create the virtual machine and install the OS on it
    9. stop the virtual machine and esxi
    10. connect DATA drives to the ESXi host
    11. begin to ESXi
    12. See how to add RDM on youtube, after client use, change first hardware VM--> add a new hard disk--> choose Raw Device Mapping--> (physical or virtual) mode--> store it with folder VM - FACT
    13. Start the virtual machine, now your VM should see both drives, with good data course :-)

    I have just made this procedure (add ROW with data in Linux VM) on ubuntu VM, works well

  • the request to turn off this virtual machine failed because the corresponding vmware tools script didn't run successfully

    using vmware fusion 2.0.5

    the request to turn off this virtual machine failed because the corresponding vmware tools script didn't run successfully

    now vmware cant off power

    is vmware tools script to run when windows is running

    If I power off (mac - force quit) now... what happens

    VMware Fusion 2.x...

    VMware Fusion (menu bar) > help > VMware Fusion help > running VMware Fusion and Virtual Machines > Shutting Down a virtual machine operating system

    VMware Fusion (menu bar) > help > VMware Fusion help > running VMware Fusion and Virtual Machines > Options for VMware Fusion food orders

    VMware Fusion (menu bar) > help > VMware Fusion help > running VMware Fusion and Virtual Machines > orders of switching power supply from the default Options

    ==========

    Note: It's like pulling the plug of the wall on a physical computer. Whatever this is not saved will be lost and there is always the possibility of corrupting the file system where preforming a hard stop! (Even if you have no choice but to do.)

    VMware Fusion menu bar > VM > press the option key and select Power Off

    By pressing the keys alt/option "Shutdown called" changes to "Power Off".

    Note: It also changes orders of "Suspend comments" and "Restart Guest' too.

    Or if this does not work then...

    On the library Virtual Machine ctrl - click on the target of the Virtual Machine and select Show in Finder and delete the .vmss file, the ctrl + click the target package of Virtual Machine, and then after the merger closed. Note: All that was not justified for the suspended state will be lost by deleting the .vmss file. Note: However: you have no other choice if the Virtual Machine does not suspend/resume/stop/start correctly.

  • rename several virtual machines based on the State of food & VM name

    I'm looking for a powershell script to rename the virtual machine based on the state name and vm power.  For example, I have several virtual machines with a - temp at the end of the name of the server.  Some are turned on and some are turned off.  I am wanting to rename only those who is off

    Thank you

    tjw82

    Assuming that - temp is part of the name

    Get - vm | where {$_.powerstate - eq "poweredoff"} | foreach {Set-machine virtual - VM $_ - name (($_.name).)} Replace ("temp", "delete"))}

  • How can I move the "Virtual Machines" folder to the My Documents folder?

    VMwareFusion is to put the "Virtual Machines" folder in the Documents folder in the home folder (/users/ [username] / Documents), how can I move elsewhere (as/Library/Application Support)? The user Documents folder is not the right place for automated it system files, it is intended for personal documents.


    I am running VMware Fusion on OS X Yosemite (and the virtual machine is Windows 7).

    You can keep your virtual machines anywhere you want. Here are the steps to move:

    1 exit VMware Fusion. You can stop first of all of your running virtual machines.

    2. drag your virtual computers folder or the individual VM "files" where you / them. Filenames usually end in ".vmwarevm". There is no need to call the new folder "Virtual Machines" - you can call it anything you like.

    3. Launch VMware Fusion. If the library of the Virtual Machine window is not open, open it (Windows menu-> Virtual Machine library).

    4. ensure that all of your icons for the virtual machine are light gray and say "file not found".

    5. right click on each virtual machine in turn, and select Remove. When you are done, leave the window of Machine virtual library empty open.

    6. in the Finder, drag the icons of file virtual machine in their new location and drop them in library of virtual machines VMware Fusion window. Drop them one by one in the original order, you got, or rearrange icons later.

    7. run your virtual machines as before.

    When you create new virtual computers, navigate to the desired file before the Save.

    IMPORTANT NOTE: If you your folder of Machines ~/Documents/Virtual excluded from backups Time Machine, don't forget to change the exclusion to the new folder.

    Time Machine backups are not reliable for virtual machines. You must have another strategy. (I shut the virtual machine down, compress the 'file', and then move the compressed file to a folder that is included in the Time Machine backups. This isn't the only strategy, but it works for me.)

  • Stop/start multiple virtual machines with names created automatically

    Hi all

    in my test environment, I want to stop or start multiple virtual machines via the script.

    Their name is always like this:

    'vm-100-qa', 'vm-101-qa","vm-100-qa","vm-102-qa '...

    Now I would like to just stop every VM 'vm-140-QA' to 'vm-160-qa.

    I created a table "$a = 140.160", but I don't know how to implement this in a script 'Shutdown-VMGuest-comments '.... »

    Sorry for this stupid question. I am a beginner absolute powershell.

    Thank you very much in advance,

    Petrie

    You can do something like this

    140..160 | %{   Shutdown-VMGuest -VM "vm-$_-qa"}
    
  • Can not power on virtual machines "cannot access the file because it is locked.

    Virtual machines have been working well - then the storage system is down.  After the storage system returns upwards that I can't turn on a number of virtual machines.  Get this error when I try to turn it on:

    Cannot power on vmname on esxhostname.xxxxx.com. Unable to access file < unspecified file name > because it is locked
    error

    1. To check the locks on the Service Console on non ESXi servers, run the command:

      lsof | grep

      COMMAND PID USER FD TYPE SIZE NŒUD NOM_PERIPHERIQUE
      71fd60b6-3631 root 4r REG 0.9 10737418240 23533

      Note: If there is no Console of Service process the locking file, you should receive no printed output. If you receive results, however, file a support request to identify the process and to determine the causes.  If it is a third-party process, however, contact the appropriate provider to determine the cause before you kill the process ID, because it can happen again in the future.

      Stop the process and the lock ID using the kill command. In the example above, the process ID is 3631:

      kill the 3631

      After the termination of the process, you can try to turn on the virtual machine or access the file resource.

    2. To check if the virtual machine is always a world ID assigned, run these commands on all ESX/ESXi hosts:

      CD/tmp
      VM-support - x

      Available to debug worlds:
      WID =

      On the ESX/ESXi host where the virtual machine still works, kill the VM, which releases the lock on the file. To kill the virtual machine, run the command:

      VM-support - X

      Where the is the ID of the world of the virtual machine with the locked file.

      Note: this command takes 5-10 minutes to complete. Answer No to "can I include a screenshot of the virtual machine", and answer Yes to all subsequent questions.

      After the termination of the process, you can turn on the virtual machine or access the file resource.

    Deleting the file .lck (NFS only)

    The virtual machine files can be locked via NFS storage. You can identify this as reported by .lck files. # (where # is the ID of the world that holds the lock file) at the end of the file name. It is a NFS file lock and appears only when you use the ls command as it is the hidden file.
    Beware: they can be removed safely only if the virtual machine is not running.

    Note: VMFS volumes have no .lck files. The locking mechanism for VMFS volumes is managed within VMFS metadata on the volume.

    You must kill the process that is locked, if it is not the case, you probably need to restart the VMware host.
    I tell you from experience most likely end up rebooting it.

Maybe you are looking for