Issue with Add-NTNXEntityToTag


I am aiming to programatically tag VMs in order to perform filter operations. For that, I am using the powershell sdk (v1) but having problems with the following call Add-NTNXEntityToTag. I created a tag (type VM) and when adding an entity
(which was created with $NewEntityDTO = New-NTNXObject –Name EntityDTO and filling the values for entityType and entityUuid) to the tag, it fails with:

At line:1 char:1
+ Add-NTNXEntityToTag -Entity $NewEntityDTO -TagUuid 2db00ea3-fe54-4ff2-ad98-a443a ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (Nutanix.Prism.Common.NutanixCluster:NutanixCluster) [Add-NTNXEntityT
oTag], WebException
+ FullyQualifiedErrorId : {"message":"Can not deserialize instance of java.util.ArrayList out of START_OBJECT to

this is the version we are using:

version : 5.1.4
fullVersion : el6-release-euphrates-5.1.4-stable-cf11e899775fdc07ae12fc5ed7763c4a07e13f0e
nccVersion : ncc-

Also , there is a filter called vm type on prism central. I see there are two types (at least on my test environment) User VM and acropolis VM.
Is that merely based on the controllerVm property (set to false in user VMs) in the VM interface or is there any other property/way which we could leverage for adding different VM types.

Thanks in advance, José Luis

0 replies

Be the first to reply!