Quantcast
Channel: VMware Communities : Discussion List - All Communities
Viewing all articles
Browse latest Browse all 176483

Find datastore of CI-VAPPTemplate

$
0
0

Hey folks,

 

in our vCloud environment we need to put a datastore into maintenance mode and make a few adjustments. I've come to find out SDRS only works on VMs and not the vAPPTemplates or Media within the vCloud catalogs. The solution is to move the items in the catalogs back into the catalog itself after disabling the datastore in vCloud director to move it to another datastore.

 

Since our environment is large it would take a very long time to do this on each catalog/item within our environment. I'm trying to identify the datastore each vAPPTemplate is on so I only need to modify those respective vAPPTemplates.

 

I started with the following code (not complete), and ran into some errors on a few vAPPTemplates.

 

[code]

$templates = Get-Org | Get-Catalog | Get-CIVAppTemplate

 

 

foreach($template in $templates) {

    Get-CIvm $template | Get-VM | Get-Datastore

}

[/code]

 

I ran some additional commands to try and identify the differences between a working $template and a non-working $template, I couldn't identify any significant difference between the two.

 

PS C:\Users\super> $templates[4] | select *

 

ExtensionData          : VMware.VimAutomation.Cloud.Views.VAppTemplate

Status                 : Resolved

Published              : False

IsGoldMaster           : False

Created                : 6/8/2013 1:04:04 PM

StorageUsedGB          : 101.734375

Catalog                : MYCUST

Owner                  : system

OrgVdc                 : 31337-SS-ALLOC-01

CustomizeOnInstantiate : True

Description            : MYCUSTXGMB01

StorageLease           :

Href                   : https://sd1.mycloud.net/api/vAppTemplate/vappTemplate-096baf80-f1fe-494f-1680a-947234b678

Id                     : urn:vcloud:vapptemplate:096baf80-f1fe-494f-1680a-947234b678

Name                   : MYCUSTXGMB01

Client                 : /CIServer=super:system@sd1.mycloud.net:443/

Uid                    : /CIServer=super:system@sd1.mycloud.net:443/CIVAppTemplate=urn:vcloud:vapptemplate:096baf80-f1fe-494f-1680a-947234b678/

 

PS C:\Users\super> $templates[5] | select *

 

ExtensionData          : VMware.VimAutomation.Cloud.Views.VAppTemplate

Status                 : Resolved

Published              : False

IsGoldMaster           : False

Created                : 6/8/2013 2:17:04 PM

StorageUsedGB          : 8

Catalog                : rambler

Owner                  : system

OrgVdc                 : 31314-SS-ALLOC-01

CustomizeOnInstantiate : False

Description            : Has vmware tools builtin

StorageLease           :

Href                   : https://sd1.mycloud.net/api/vAppTemplate/vappTemplate-61db057d-cc31-4a79-7c781-d47b47bb76

Id                     : urn:vcloud:vapptemplate:61db057d-cc31-4a79-7c781-d47b47bb76

Name                   : Ubuntu 12 LTS

Client                 : /CIServer=super:system@sd1.mycloud.net:443/

Uid                    : /CIServer=super:system@sd1.mycloud.net:443/CIVAppTemplate=urn:vcloud:vapptemplate:61db057d-cc31-4a79-7c781-d47b47bb76/

 

PS C:\Users\super> get-civm $templates[4]

Name                           Status                      GuestOSFullName                          CpuCount MemoryGB     

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

MYCUSTXGMB01                      PoweredOff                  Microsoft Windows Server 2003 (32-bit)   4        3.750        

 

PS C:\Users\super> get-civm $templates[5]

get-civm : 8/20/2013 10:07:05 AM    Get-CIVM        CIVM with name 'Ubuntu 12 LTS' was not found using the specified filter(s).  

At line:1 char:1

+ get-civm $templates[5]

+ ~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : ObjectNotFound: (:) [Get-CIVM], VimException

    + FullyQualifiedErrorId : Core_OutputHelper_WriteNotFoundError,VMware.VimAutomation.Cloud.Commands.Cmdlets.GetCIVM

 

PS C:\Users\super>

 

I tried doing it manually as well

 

PS C:\Users\super> $mytmp = get-org -name orgName | get-catalog -name catalogName | Get-CIVAppTemplate

PS C:\Users\super> Get-CIVM $mytmp

Get-CIVM : 8/20/2013 10:21:15 AM    Get-CIVM        CIVM with name 'Ubuntu 12 LTS' was not found using the specified filter(s)

 

I'm able to identify the VM template in vCenter named "Ubuntu 12 LTS", not seems out of the oridinary with it. I'm not able to figure out why some of these vAPPTemplates return an error and some do not.

 

Any insight or direction is greatly appreciated.


Viewing all articles
Browse latest Browse all 176483

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>