VMware Cloud Community
arccons
Contributor
Contributor

New-CIVApp failed to create vApp from vAppTemplate in vCloud

Hello:

I tried to create a vApp from a vAppTemplate using the command:

New-CIVApp -Name $vAppName -Description "This vApp is created from PowerCLI" -OrgVdc $orgVDC -VAppTemplate $vAppTempl

The problem is the New-CIVApp cmdlet returns a failure message saying:

New-CIVApp : 2/28/2018 2:37:49 AM    New-CIVApp        Entity with id urn:vcloud:vapp:377a2c02-94cc-4c8c-918e-7f231bc3606e was not found.

At C:\vCloud\vCloud.ps1:29 char:9

+         New-CIVApp -Name $vAppName -Description "This vApp is created ...

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

    + CategoryInfo          : ObjectNotFound: (urn:vcloud:vapp...8e-7f231bc3606e:String) [New-CIVApp], CIEntityNotFoundException

    + FullyQualifiedErrorId : Core_CloudImpl_EntityNotFound,VMware.VimAutomation.Cloud.Commands.Cmdlets.NewCIVApp

But actually the vApp is created there in the vCloud when I log into from a browser.

I also can get it with the cmdlet: $CIVApp = Get-CIVApp -name $vAppName

And, $CIVApp.ExtensionData.id returns exactly the one (urn:vcloud:vapp:377a2c02-94cc-4c8c-918e-7f231bc3606e) that New-CIVApp could not find.

My Environment:

vCloud Director - 5.5.6

PowerCli - 6.5.4.7155375

Powershell -  5.1.14409.1012

OS: Windows 7 SP1 (build 7601)

I later checked the VMware Product Interoperability Matrices page and got to know that the newest version of PowerCLI that vCloud 5.5 supports is 6.3 so I tried it in another environment with PowerCLI 6.3, but got the same result still.

Anyone can help me out of this, any helps appreciated.

Reply
0 Kudos
8 Replies
arccons
Contributor
Contributor

Ok, I've identified it seemed to be caused by an invalid character "+" in the vApp name I created, as it's from a timestamp.

Once I removed this character all go well.

But, it seems ok to use this special character if I create new vApp in web page.

So it seems something not right in the PowerCLI to retrive vApp object if its name contains special character?

Reply
0 Kudos
LucD
Leadership
Leadership

Did you try placing the name, with the special character, in single quotes?


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

Reply
0 Kudos
arccons
Contributor
Contributor

It doesn't include the double quotes in the vApp name actually, I just use it to indicate the character here.

Reply
0 Kudos
LucD
Leadership
Leadership

No, I mean the complete name, including the + sign, in single quotes


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

Reply
0 Kudos
arccons
Contributor
Contributor

Do you mean like this?

$vAppName = 'myVApp+2018-2-28'

New-CIVApp -Name $vAppName -Description "This vApp is created from PowerCLI"  -OrgVdc $orgVDC -VAppTemplate $vAppTempl

Same problem with using double quote: $vAppName = "myVApp+2018-2-28"

Reply
0 Kudos
LucD
Leadership
Leadership

Yes, but it doesn't seem to help.
I suggest to open a SR, looks indeed like a PowerCLI issue.


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

Reply
0 Kudos
LordofVxRail
Enthusiast
Enthusiast

apoligies for digging up old thread, seem to be an issue on the latest powercli too.

my vapp name has a + 

 

Restart-CIVApp : 6/21/2022 12:05:44 PM	Restart-CIVApp		Entity with id urn:vcloud:vapp:76fcf2b6-ee2a-4fc1-94ed-69f80808890f was not found.	
At C:\scripts\reference_clusters\reboot_ref.ps1:25 char:50
+ ... ike $vapp} |Restart-CIVApp -WarningAction SilentlyContinue -Confirm:$ ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (urn:vcloud:vapp...ed-69f80808890f:String) [Restart-CIVApp], CIEntityNotFoundException
    + FullyQualifiedErrorId : Core_CloudImpl_EntityNotFound,VMware.VimAutomation.Cloud.Commands.Cmdlets.VApp.RestartCIVApp

 

 

Reply
0 Kudos
LordofVxRail
Enthusiast
Enthusiast

ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Script 1.0.0.0 ISE {Get-IseSnippet, Import-IseSnippet, New-IseSnippet}
Manifest 3.1.0.0 Microsoft.PowerShell.Management {Add-Computer, Add-Content, Checkpoint-Computer, Clear-Content...}
Manifest 3.1.0.0 Microsoft.PowerShell.Utility {Add-Member, Add-Type, Clear-Variable, Compare-Object...}
Script 7.0.3.19601056 VMware.Vim
Script 12.6.0.19601368 VMware.VimAutomation.Cis.Core {Connect-CisServer, Disconnect-CisServer, Get-CisService}
Script 12.0.0.15940183 VMware.VimAutomation.Cloud {Add-CIDatastore, Connect-CIServer, Disconnect-CIServer, Get-Catalog...}
Script 12.6.0.19600917 VMware.VimAutomation.Common {Get-PowerCLIContext, Get-Task, New-OAuthSecurityContext, Stop-Task...}
Script 12.6.0.19601570 VMware.VimAutomation.Core {Add-PassthroughDevice, Add-VirtualSwitchPhysicalNetworkAdapter, Add-VMHost, Add-VMHostNtpServer...}
Script 12.5.0.19093564 VMware.VimAutomation.Sdk {Get-ErrorReport, EnableParameterCompleters, Get-InstallPath, Get-PSVersion}
Script 12.6.0.19609013 VMware.VimAutomation.Storage {Add-EntityDefaultKeyProvider, Add-KeyManagementServer, Add-VsanFileServiceOvf, Add-VsanObjectToRepairQueue...}
Script 12.5.0.19167830 VMware.VimAutomation.Vds {Add-VDSwitchPhysicalNetworkAdapter, Add-VDSwitchVMHost, Export-VDPortGroup, Export-VDSwitch...}

Reply
0 Kudos