VMware Cloud Community
Yeonki
Contributor
Contributor

No result with get-template execution on ESXi 5.0

Hi, all.

There are four templates. One of them is  'NagiosTemplate'.

When I ran get-template, It returned messaged that they not found.

PS C:\> Get-Template NagiosTemplate
Get-Template : 2012-11-22 PM 3:23:05    Get-Template        Template with name 'NagiosTemplate' was not found using t
he specified filter(s).
At line:1 char:13
+ Get-Template <<<<  NagiosTemplate -Verbose
    + CategoryInfo          : ObjectNotFound: (:) [Get-Template], VimException
    + FullyQualifiedErrorId : Core_OutputHelper_WriteNotFoundError,VMware.VimAutomation.ViCore.Cmdlets.Commands.GetTemplate

It was the same with no template name and there was no result.

PS C:\> Get-Template

PS C:\>

I can see templates only by using viclient.

How can I do to get templates?

Yeonki,

Best regards.

Tech Blog: http://hyper-choi.blogspot.com
0 Kudos
6 Replies
LucD
Leadership
Leadership

Are the other Get- cmdlets producing results ?

For example, Get-VM or Get-VMHost ?

Are these templates you see in the vSphee CLient perhaps on another vCenter that is in linked mode ?

How are the PowerCLI settings ?

Do a

Get-PowerCLIConfiguration | Select *


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

0 Kudos
Yeonki
Contributor
Contributor

Hi, LucD

Thanks for reponse.

Yes, Other Cmdlets work.

PS C:\> Get-VM
Name                 PowerState Num CPUs MemoryGB
--------                  ---------------- ---------------- ----------------
CentOS6             PoweredOff  1             2.000
altibase               PoweredOn  1            2.000
NagiosSnmpTest PoweredOn   1            1.000
swift-storage1      PoweredOff   1            1.000
DeploytempVM    PoweredOff   1            2.000

PS C:\> Get-VMHost

Name                 ConnectionState PowerState NumCpu CpuUsageMhz CpuTotalMhz   MemoryUsageGB   MemoryTotalGB Version

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

192.168.20.162       Connected       PoweredOn       6                      32           16794                     1.638        7.749             5.0.0

But, Get-Template doesn't.

And second result is as follows:

PS C:\> Get-PowerCLIConfiguration | Select *

DefaultVIServerMode        : Multiple

ProxyPolicy                : UseSystemProxy

DisplayDeprecationWarnings : True

InvalidCertificateAction   : Unset

WebOperationTimeoutSeconds : 300

Scope                      : Session

DefaultVIServerMode        : Multiple

ProxyPolicy                :

DisplayDeprecationWarnings :

InvalidCertificateAction   :

WebOperationTimeoutSeconds :

Scope                      : User

DefaultVIServerMode        :

ProxyPolicy                :

DisplayDeprecationWarnings :

InvalidCertificateAction   :

WebOperationTimeoutSeconds :

Scope                      : AllUsers

Thanks and regrads,

Yeonki

Tech Blog: http://hyper-choi.blogspot.com
0 Kudos
LucD
Leadership
Leadership

Forgot the obvious question, are you connected to a vCenter or an ESXi server (Connect-VIServer) ?

You need to be connected to a vCenter to see and work with templates afaik


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

0 Kudos
Yeonki
Contributor
Contributor

Thanks LucD.

When I connect to vCenter server, getTemplate cmdlet works.

PS C:\> Get-Template
Name
-----------------------
NagiosTemplate
altibase templ 3
Altibase templ
Altibase templ 2

Before, I connected to ESXi Server directly.

Can I ask why this happen?

Thanks and regards,

Yeonki.

Tech Blog: http://hyper-choi.blogspot.com
0 Kudos
LucD
Leadership
Leadership

Working with templates is a feature from vCenter and is not available on ESXi servers.


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

0 Kudos
Yeonki
Contributor
Contributor

I understand it.

Thank you.

Yeonki.

Tech Blog: http://hyper-choi.blogspot.com
0 Kudos