VMware Cloud Community
StanleyLiu
Contributor
Contributor
Jump to solution

PowerCLI use "Start-VM" command, response id is wrong

$StartVMInfo = Start-VM -VM VMName -ErrorAction Stop -RunAsync

$StartVMInfo | Format-List

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

Client                  :

CmdletTaskInfo          :

ExtensionData           :

Id                      : 4d1b8409-17b1-492e-9b70-060c422e2db0

IsCancelable            : False

Result                  :

Name                    :

Description             :

State                   : Error

PercentComplete         : 100

StartTime               : 2018/11/27 下午 02:19:50

FinishTime              : 2018/11/27 下午 02:19:50

ObjectId                :

Uid                     : /Local=/ClientSideTask=4d1b8409-17b1-492e-9b70-060c422e2db0/

NonTerminatingErrorList : {}

TerminatingError        : VMware.VimAutomation.ViCore.Types.V1.ErrorHandling.Invalid.........

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

Why only "Start-vm" this command response is wrong, "stop-vm" this command is right

Reply
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

That is correct.
The PowerCLI cmdlets decide, based on a number of criteria, if a cmdlet becomes a CST or a SST.

We touched that subject in our VMworld session VIN1992BE.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

Reply
0 Kudos
4 Replies
LucD
Leadership
Leadership
Jump to solution

The RunAsync option on the Start-VM cmdlet resulted in a so-called Client Side Task (CST).

This is not a regular Server Side Task (SST).
Hence the Id you are seeing is not a regular TaskId.

Or do you mean something else?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
StanleyLiu
Contributor
Contributor
Jump to solution

LucD

Hi LucD

When I use "Stop-VM", the response is SST A.K.A. Task-task-xxxxx.

this also true for the following commands "New-Snapshot"、"Set-VM"、"Remove-Snapshot"

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

$StopVMInfo = Stop-VM -VM $EnvInfo.VMName -Confirm: $false -RunAsync -ErrorAction Stop

$StopVMInfo | Format-List

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

ServerId        : /VIServer=vsphere.local\administrator@10.10.10.63:443/

State           : Queued

IsCancelable    : False

PercentComplete : 0

StartTime       : 2018/11/27 下午 03:57:40

FinishTime      :

ObjectId        : VirtualMachine-vm-2080

Result          :

Description     : Power Off virtual machine

ExtensionData   : VMware.Vim.Task

Id              : Task-task-62174

Name            : PowerOffVM_Task

Uid             : /VIServer=vsphere.local\administrator@10.10.10.63:443/Task=Task-task-62174/

Client          : VMware.VimAutomation.ViCore.Impl.V1.VimClient

CmdletTaskInfo  : VMware.VimAutomation.Sdk.Util10.Task.CmdletTaskInfoImpl

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

That is correct.
The PowerCLI cmdlets decide, based on a number of criteria, if a cmdlet becomes a CST or a SST.

We touched that subject in our VMworld session VIN1992BE.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
StanleyLiu
Contributor
Contributor
Jump to solution

Thans a lot

Reply
0 Kudos