VMware Cloud Community
VPXA
Enthusiast
Enthusiast

Schedule task's not running after vCenter Upgrade to 7.x

 

Hi All,

Can any one please provide me some fixe's towards scheduled tasks.
Recently we have upgraded vCenter from 6.5u3 to 7.x, later the existing automated PS scripts are not working and not getting daily reports. Such SnapShot Utilizations / DC Capacity / DataStores Health / Env.All Hosts Informaton.
Our Hosts are running with vSphere 6.5u3, other vCenter 6.5u3 with vSphere 6.5u3 running fine.

Is there any unsupported version's b/w vCenter 7.x vs vSphere 6.5. Please suggest me in finding a solution for this situation.

Supported Versions of PowerCLI in vCenter 7.x with vSphere 6.5?

0 Kudos
15 Replies
LucD
Leadership
Leadership

You'll have to provide a bit more information.
Are you talking about Scheduled Tasks running in vCenter, or tasks running from within Windows Task Scheduler?
In both cases, how did you define those scheduled tasks?
What account are they running under?
Are you calling PS v5.* or PSv7, ...?


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

0 Kudos
VPXA
Enthusiast
Enthusiast

You'll have to provide a bit more information. Are you talking about Scheduled Tasks running in vCenter, or tasks running from within Windows Task Scheduler?

Yes -- we are running these from a remote machine Task Scheduler.

In both cases, how did you define those scheduled tasks?

Using same scripts for both vCenter's.

vCenter1 -- running with vCenter 7 & vSphere 6.5 ( Scripts not giving any output)

vCenter2 -- Running vCenter 6.5 & vSphere 6.5 ( Scripts working fine)

What account are they running under?

As trying for a solution running a script using my admin account from desktop.

we are using a Service account. As trying for a solution running a script using my admin account from desktop. Are you calling PS v5.* or PSv7, ...?

PSv7

0 Kudos
LucD
Leadership
Leadership

I would have to see the script you are running and how the scheduled task is defined on that remote Task Scheduler


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

0 Kudos
VPXA
Enthusiast
Enthusiast

Uploaded the old script, could you please review once and suggest me.

VPXA_0-1685991875406.png

 

0 Kudos
LucD
Leadership
Leadership

That script is using Get- and Add-PSSnapin.
PowerCLI stopped using PSSnapins in version 6.0 (in 2015Q1), we are currently at PowerCLI 13.1.
Are you saying you are still using such an old PowerCLI version?
Isn't there any info about that in the transscript log?


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

0 Kudos
VPXA
Enthusiast
Enthusiast

 


That script is using Get- and Add-PSSnapin.
PowerCLI stopped using PSSnapins in version 6.0 (in 2015Q1), we are currently at PowerCLI 13.1.
Are you saying you are still using such an old PowerCLI version? -- Yes, we are still using these., Could you please suggest me, what to do next.
any upgradations require or if I want set up for this requirement, please guide me to, it is a big task on me now to fix.
Isn't there any info about that in the transscript log?

0 Kudos
LucD
Leadership
Leadership

Follow the procedure documented in Updating PowerCLI through the PowerShell Gallery - VMware PowerCLI Blog


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

VPXA
Enthusiast
Enthusiast

Thank you so much for this information.

After upgradation existing scripts, will work or do we need to jump in and get those from any public repo's.

vCenter 7.x with vSphere 6.5 host's, these type of script must Run right?

Because, we had a case with VMware support, was not get an good information to fix!

0 Kudos
LucD
Leadership
Leadership

Not sure what exactly you are asking.

You will have to update the script to not use the PSSnapin anymore.


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

0 Kudos
VPXA
Enthusiast
Enthusiast

Sorry its typo error, after upgrading the _PS version vs Old Scripts!!

could you please provide me any repo' url to get the latest scripts to be run.

looking for Daily Snapshot Utilization / DataStore Utilization type of script'.s

0 Kudos
VPXA
Enthusiast
Enthusiast

Hi 

Thanks for your guidance, now scripts started working tested on Snapshot Script getting below out put. Can you please suggest to get this report in .csv or html format or in best format's.

PowerShell 5.x

PowerCLI 13.x  with configuration again its working.

 

VPXA_0-1686144210157.png

 

0 Kudos
LucD
Leadership
Leadership

The script is producing output in HTML format.
Not sure what you are asking.


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

0 Kudos
VPXA
Enthusiast
Enthusiast

Just looking for a report like below or in a .csv format.

VPXA_0-1686160385527.png

please help in this.

0 Kudos
LucD
Leadership
Leadership

This thread is going all over the place it seems.
First, it was that your old script didn't run on vCenter 7.*, now you ask for a way to apply a style to HTML output.

If you search in this community there are plenty of examples of using a CSS style sheet with ConvertTo-Html.


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

0 Kudos
VPXA
Enthusiast
Enthusiast

Thanks for all your assistance, after spinning 2019 Windows Server along with PS 5.x and VMware PS 13.x all started working. 

0 Kudos