VCPGuru
Contributor
Contributor

verify if clone job was successful

Jump to solution

dear all

today I am cloning VMs with my vCenter (Scheduled tasks) and I delete my clones with Powershell PowerCLI.

But if f.e. my datastore is full, the clone job wont be successful, in this case I want to get an alert.

How could I verify if my clone job was sucessfull?

Thank you in advance

Best Regards Simon Ciglia
0 Kudos
1 Solution

Accepted Solutions
RvdNieuwendijk
Leadership
Leadership

You can try:

(Get-Task | Where-Object { $_.Name -eq "CloneVM_Task"}).State

The Get-Task cmdlet retrieves information about the current or recent tasks.

The state value returned is Error, Queued, Running, or Success.

Robert

Blog: https://rvdnieuwendijk.com/ | Twitter: @rvdnieuwendijk | Author of: https://www.packtpub.com/virtualization-and-cloud/learning-powercli-second-edition

View solution in original post

0 Kudos
1 Reply
RvdNieuwendijk
Leadership
Leadership

You can try:

(Get-Task | Where-Object { $_.Name -eq "CloneVM_Task"}).State

The Get-Task cmdlet retrieves information about the current or recent tasks.

The state value returned is Error, Queued, Running, or Success.

Robert

Blog: https://rvdnieuwendijk.com/ | Twitter: @rvdnieuwendijk | Author of: https://www.packtpub.com/virtualization-and-cloud/learning-powercli-second-edition
0 Kudos