VMware Cloud Community
pkharekofax
Enthusiast
Enthusiast
Jump to solution

vCloud Director 5.5 PowerCLI issue with vApp and VM names with +, & and #

Hi all,

I get an "ObjectNotFound" error while trying to get vApps and VMs using Get-CIvApp, Get-CIvAppTemplate, or Get-CIVM for vApps and VMs that have +, &, or # in their name.

If I rename the vApp or VM and replace these characters, by say, a dash, there's no problem.  Also, if I try to get the vApp for a VM using (get-civm vmname).vapp, it doesn't return anything if the vApp name has +, &, or #. 

This is with the latest release of PowerCLI.  Has anyone else seen this, and is there a solution other than us renaming all such vApps and VMs?

In the vCloud Director GUI, if you search with these characters, press back arrow and then front arrow, these characters get replaced by Percent Encoding in the search box, e.g. + gets replaced by %2B.

Thanks,

Khare

E.g. We have a vApp with a '+' in its name: "KTA 7.3.1 + SP", and it has a VM "SharePoint_2013".

========================= Before renaming: ============================

We see the VM.

PS>get-civm Sharepoint_2013

Name Status GuestOSFullName CpuCount MemoryGB

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

SharePoint_2013 Suspended Microsoft Windows Server 2008 R2 (64-... 1        4.000

We try to get its vApp, but it returns nothing.

PS>(get-civm Sharepoint_2013).vapp

Try looking for the vApp itself that has a '+' in its name, nothing is returned.

PS>Get-CIVApp "KTA 7.3.1 + SP"

Get-CIVApp : 6/28/2017 7:59:11 AM    Get-CIVApp CIVApp with name 'KTA 7.3.1 + SP' was not found using the specifi

At line:1 char:1

+ Get-CIVApp "KTA 7.3.1 + SP"

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

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

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

========================= After renaming + to - : ============================

Look for the vApp, now we find it.

PS>Get-CIVApp "KTA 7.3.1 - SP"

Name Enabled InMaintenanceMode    Owner

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

KTA 7.3.1 - SP True False conor.callan

Look for the VM’s vApp, we find it this way as well.

PS>(get-civm Sharepoint_2013).vapp

Name Enabled InMaintenanceMode    Owner

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

KTA 7.3.1 - SP True False conor.callan

Reply
0 Kudos
1 Solution

Accepted Solutions
mhampto
VMware Employee
VMware Employee
Jump to solution

Hello,

Naming virtual machines with these characters is not recommended as it may exhibit abnormal behaviors as you are seeing.  For more information on this: Troubleshooting issues with VMs or datastore names containing special characters (2046088) | VMware ...

If you are able to create VM's without the special characters, that is the best resolution.

Matt

View solution in original post

Reply
0 Kudos
3 Replies
mhampto
VMware Employee
VMware Employee
Jump to solution

Hello,

Naming virtual machines with these characters is not recommended as it may exhibit abnormal behaviors as you are seeing.  For more information on this: Troubleshooting issues with VMs or datastore names containing special characters (2046088) | VMware ...

If you are able to create VM's without the special characters, that is the best resolution.

Matt

Reply
0 Kudos
jfrmilner
Contributor
Contributor
Jump to solution

I have the same issue and have noticed this also happens on orgvdc's.

PS C:\> Get-OrgVdc -Name 'Martin & Smith'

Get-OrgVdc : 26/07/2017 12:08:07 Get-OrgVdc Bad request: Unmatched opening and closing brackets in expression isSystemVdc==false;(name==Martin%20.

At line:1 char:1

This issue even shows when using an ID of a orgvdc that has & in the name

PS C:\> Get-OrgVdc -Id 'urn:vcloud:vdc:fcfeb669-6ac7-40c1-b5b1-fd6c9049ca22'

Get-OrgVdc : 26/07/2017 12:04:24 Get-OrgVdc Bad request: Unmatched opening and closing brackets in expression isSystemVdc==false;(name==Martin%20.

At line:1 char:1

Seems like a bug in PowerShell.

@mhampto - Thanks for the KB but as a Public vCloud service providers we cannot guarantee customers are going to follow kbs, I always assume if they can do something then they will.

Reply
0 Kudos
pkharekofax
Enthusiast
Enthusiast
Jump to solution

It would be nice if the GUI itself blocks users from entering such data in the first place.

Thanks,

Khare

Reply
0 Kudos