VMware Cloud Community
vin01
Expert
Expert
Jump to solution

Name in vSphere for catalog vApp templates

Is it possible to get the Name in vSphere for vapp template vms in vcloud director.

I can get the name mentioned in vcenter for CI VM using below cmdlets

$vm=Get-CIVM

Get-View –RelatedObject $vm

but not able to get for vapp template vms.

Here is the script I am missing the full name in vcenter for a vapp template.

foreach($org in Get-Org |Sort-Object -Property Name){

foreach($catlog in ($org|Get-Catalog  | Sort-Object -Property Name)){

foreach($VAppTemplate in ($catlog |Get-CIVAppTemplate | Sort-Object -Property Name)){

foreach($CIVMTemplate in ($VAppTemplate |Get-CIVMTemplate | Sort-Object -Property Name)){

"" |Select-Object  @{N="Org Name";E={$catlog.Org}},

@{N="Catlog Name";E={$catlog.Name}},

@{N="Catlog Owner";E={$catlog.Owner}},

@{N="VAppTemplate Name";E={$VAppTemplate.Name}},

@{N="VAppTemplate Owner";E={$VAppTemplate.Owner}},

@{N="VMTemplate Name";E={$CIVMTemplate.Name}}

}

}

}

}

Regards Vineeth.K
Reply
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Did you try passing it to Get-CIView first?


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

View solution in original post

Reply
0 Kudos
6 Replies
LucD
Leadership
Leadership
Jump to solution

Did you already try changing

foreach($CIVMTemplate in ($VAppTemplate |Get-CIVMTemplate | Sort-Object -Property Name)){
to

foreach($CIVMTemplate in (Get-CIVMTemplate -VAppTemplate $VAppTemplate | Sort-Object -Property Name)){

I don't think the VAppTemplate parameter can be passed through the pipeline.


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

vin01
Expert
Expert
Jump to solution

It worked for me I can able to get the output

pastedImage_0.png

but I am trying to get the name which is given in vcenter for vapp template.

pastedImage_1.png

why this cmdlet is not working for vapp template objects?

pastedImage_2.png

same is working for virtualmachine objects

pastedImage_3.png

Regards Vineeth.K
Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

Did you try passing it to Get-CIView first?


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

Reply
0 Kudos
vin01
Expert
Expert
Jump to solution

Thanks its working  after passing Get-CIview.Smiley Happy

Regards Vineeth.K
Reply
0 Kudos
HDVM
Contributor
Contributor
Jump to solution

I have the same issue but i am a bit confused  could you provide the complete  code. When you say pass  get-ciview do i pass it to get -view -relatedobject ?

Because that does not work

Reply
0 Kudos
Catalyph
Contributor
Contributor
Jump to solution

Could you elaborate on this, I have tried a few different ways but I cant get it to work.

Reply
0 Kudos