Viewing docs for Nutanix v0.16.0
published on Tuesday, May 26, 2026 by Piers Karsenbarg
published on Tuesday, May 26, 2026 by Piers Karsenbarg
Viewing docs for Nutanix v0.16.0
published on Tuesday, May 26, 2026 by Piers Karsenbarg
published on Tuesday, May 26, 2026 by Piers Karsenbarg
Retrieve the VM-VM Anti-Affinity policy details for the provided external identifier (ext_id).
Example
import * as pulumi from "@pulumi/pulumi";
import * as nutanix from "@pierskarsenbarg/nutanix";
const policy = nutanix.getVmAntiAffinityPolicyV2({
extId: "12345678-1234-1234-1234-123456789012",
});
export const policyName = policy.then(policy => policy.name);
import pulumi
import pulumi_nutanix as nutanix
policy = nutanix.get_vm_anti_affinity_policy_v2(ext_id="12345678-1234-1234-1234-123456789012")
pulumi.export("policyName", policy.name)
package main
import (
"github.com/pierskarsenbarg/pulumi-nutanix/sdk/go/nutanix"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
policy, err := nutanix.GetVmAntiAffinityPolicyV2(ctx, &nutanix.LookupVmAntiAffinityPolicyV2Args{
ExtId: "12345678-1234-1234-1234-123456789012",
}, nil)
if err != nil {
return err
}
ctx.Export("policyName", policy.Name)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Nutanix = PiersKarsenbarg.Nutanix;
return await Deployment.RunAsync(() =>
{
var policy = Nutanix.GetVmAntiAffinityPolicyV2.Invoke(new()
{
ExtId = "12345678-1234-1234-1234-123456789012",
});
return new Dictionary<string, object?>
{
["policyName"] = policy.Apply(getVmAntiAffinityPolicyV2Result => getVmAntiAffinityPolicyV2Result.Name),
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.nutanix.NutanixFunctions;
import com.pulumi.nutanix.inputs.GetVmAntiAffinityPolicyV2Args;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var policy = NutanixFunctions.getVmAntiAffinityPolicyV2(GetVmAntiAffinityPolicyV2Args.builder()
.extId("12345678-1234-1234-1234-123456789012")
.build());
ctx.export("policyName", policy.name());
}
}
variables:
policy:
fn::invoke:
function: nutanix:getVmAntiAffinityPolicyV2
arguments:
extId: 12345678-1234-1234-1234-123456789012
outputs:
policyName: ${policy.name}
pulumi {
required_providers {
nutanix = {
source = "pulumi/nutanix"
}
}
}
data "nutanix_getvmantiaffinitypolicyv2" "policy" {
ext_id = "12345678-1234-1234-1234-123456789012"
}
output "policyName" {
value = data.nutanix_getvmantiaffinitypolicyv2.policy.name
}
Using getVmAntiAffinityPolicyV2
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getVmAntiAffinityPolicyV2(args: GetVmAntiAffinityPolicyV2Args, opts?: InvokeOptions): Promise<GetVmAntiAffinityPolicyV2Result>
function getVmAntiAffinityPolicyV2Output(args: GetVmAntiAffinityPolicyV2OutputArgs, opts?: InvokeOptions): Output<GetVmAntiAffinityPolicyV2Result>def get_vm_anti_affinity_policy_v2(ext_id: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetVmAntiAffinityPolicyV2Result
def get_vm_anti_affinity_policy_v2_output(ext_id: pulumi.Input[Optional[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetVmAntiAffinityPolicyV2Result]func LookupVmAntiAffinityPolicyV2(ctx *Context, args *LookupVmAntiAffinityPolicyV2Args, opts ...InvokeOption) (*LookupVmAntiAffinityPolicyV2Result, error)
func LookupVmAntiAffinityPolicyV2Output(ctx *Context, args *LookupVmAntiAffinityPolicyV2OutputArgs, opts ...InvokeOption) LookupVmAntiAffinityPolicyV2ResultOutput> Note: This function is named LookupVmAntiAffinityPolicyV2 in the Go SDK.
public static class GetVmAntiAffinityPolicyV2
{
public static Task<GetVmAntiAffinityPolicyV2Result> InvokeAsync(GetVmAntiAffinityPolicyV2Args args, InvokeOptions? opts = null)
public static Output<GetVmAntiAffinityPolicyV2Result> Invoke(GetVmAntiAffinityPolicyV2InvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetVmAntiAffinityPolicyV2Result> getVmAntiAffinityPolicyV2(GetVmAntiAffinityPolicyV2Args args, InvokeOptions options)
public static Output<GetVmAntiAffinityPolicyV2Result> getVmAntiAffinityPolicyV2(GetVmAntiAffinityPolicyV2Args args, InvokeOptions options)
fn::invoke:
function: nutanix:index/getVmAntiAffinityPolicyV2:getVmAntiAffinityPolicyV2
arguments:
# arguments dictionarydata "nutanix_getvmantiaffinitypolicyv2" "name" {
# arguments
}The following arguments are supported:
- Ext
Id string - The external identifier of a VM-VM Anti-Affinity policy.
- Ext
Id string - The external identifier of a VM-VM Anti-Affinity policy.
- ext_
id string - The external identifier of a VM-VM Anti-Affinity policy.
- ext
Id String - The external identifier of a VM-VM Anti-Affinity policy.
- ext
Id string - The external identifier of a VM-VM Anti-Affinity policy.
- ext_
id str - The external identifier of a VM-VM Anti-Affinity policy.
- ext
Id String - The external identifier of a VM-VM Anti-Affinity policy.
getVmAntiAffinityPolicyV2 Result
The following output properties are available:
- Categories List<string>
- List of VM category external IDs that this policy applies to.
- Create
Time string - The timestamp when the policy was created.
- Created
By Dictionary<string, string> - Information about the entity that created the policy.
- Description string
- A description of the VM-VM Anti-Affinity policy.
- Ext
Id string - Id string
- The provider-assigned unique ID for this managed resource.
- Name string
- The name of the VM-VM Anti-Affinity policy.
- Num
Compliant intVms - Number of compliant VMs which are part of the VM-VM anti-affinity policy.
- Num
Non intCompliant Vms - Number of non-compliant VMs which are part of the VM-VM anti-affinity policy.
- Num
Pending intVms - Number of VMs with compliance state as pending, which are part of the VM-VM anti-affinity policy.
- Update
Time string - The timestamp when the policy was last updated.
- Updated
By Dictionary<string, string> - Information about the entity that last updated the policy.
- Categories []string
- List of VM category external IDs that this policy applies to.
- Create
Time string - The timestamp when the policy was created.
- Created
By map[string]string - Information about the entity that created the policy.
- Description string
- A description of the VM-VM Anti-Affinity policy.
- Ext
Id string - Id string
- The provider-assigned unique ID for this managed resource.
- Name string
- The name of the VM-VM Anti-Affinity policy.
- Num
Compliant intVms - Number of compliant VMs which are part of the VM-VM anti-affinity policy.
- Num
Non intCompliant Vms - Number of non-compliant VMs which are part of the VM-VM anti-affinity policy.
- Num
Pending intVms - Number of VMs with compliance state as pending, which are part of the VM-VM anti-affinity policy.
- Update
Time string - The timestamp when the policy was last updated.
- Updated
By map[string]string - Information about the entity that last updated the policy.
- categories list(string)
- List of VM category external IDs that this policy applies to.
- create_
time string - The timestamp when the policy was created.
- created_
by map(string) - Information about the entity that created the policy.
- description string
- A description of the VM-VM Anti-Affinity policy.
- ext_
id string - id string
- The provider-assigned unique ID for this managed resource.
- name string
- The name of the VM-VM Anti-Affinity policy.
- num_
compliant_ numbervms - Number of compliant VMs which are part of the VM-VM anti-affinity policy.
- num_
non_ numbercompliant_ vms - Number of non-compliant VMs which are part of the VM-VM anti-affinity policy.
- num_
pending_ numbervms - Number of VMs with compliance state as pending, which are part of the VM-VM anti-affinity policy.
- update_
time string - The timestamp when the policy was last updated.
- updated_
by map(string) - Information about the entity that last updated the policy.
- categories List<String>
- List of VM category external IDs that this policy applies to.
- create
Time String - The timestamp when the policy was created.
- created
By Map<String,String> - Information about the entity that created the policy.
- description String
- A description of the VM-VM Anti-Affinity policy.
- ext
Id String - id String
- The provider-assigned unique ID for this managed resource.
- name String
- The name of the VM-VM Anti-Affinity policy.
- num
Compliant IntegerVms - Number of compliant VMs which are part of the VM-VM anti-affinity policy.
- num
Non IntegerCompliant Vms - Number of non-compliant VMs which are part of the VM-VM anti-affinity policy.
- num
Pending IntegerVms - Number of VMs with compliance state as pending, which are part of the VM-VM anti-affinity policy.
- update
Time String - The timestamp when the policy was last updated.
- updated
By Map<String,String> - Information about the entity that last updated the policy.
- categories string[]
- List of VM category external IDs that this policy applies to.
- create
Time string - The timestamp when the policy was created.
- created
By {[key: string]: string} - Information about the entity that created the policy.
- description string
- A description of the VM-VM Anti-Affinity policy.
- ext
Id string - id string
- The provider-assigned unique ID for this managed resource.
- name string
- The name of the VM-VM Anti-Affinity policy.
- num
Compliant numberVms - Number of compliant VMs which are part of the VM-VM anti-affinity policy.
- num
Non numberCompliant Vms - Number of non-compliant VMs which are part of the VM-VM anti-affinity policy.
- num
Pending numberVms - Number of VMs with compliance state as pending, which are part of the VM-VM anti-affinity policy.
- update
Time string - The timestamp when the policy was last updated.
- updated
By {[key: string]: string} - Information about the entity that last updated the policy.
- categories Sequence[str]
- List of VM category external IDs that this policy applies to.
- create_
time str - The timestamp when the policy was created.
- created_
by Mapping[str, str] - Information about the entity that created the policy.
- description str
- A description of the VM-VM Anti-Affinity policy.
- ext_
id str - id str
- The provider-assigned unique ID for this managed resource.
- name str
- The name of the VM-VM Anti-Affinity policy.
- num_
compliant_ intvms - Number of compliant VMs which are part of the VM-VM anti-affinity policy.
- num_
non_ intcompliant_ vms - Number of non-compliant VMs which are part of the VM-VM anti-affinity policy.
- num_
pending_ intvms - Number of VMs with compliance state as pending, which are part of the VM-VM anti-affinity policy.
- update_
time str - The timestamp when the policy was last updated.
- updated_
by Mapping[str, str] - Information about the entity that last updated the policy.
- categories List<String>
- List of VM category external IDs that this policy applies to.
- create
Time String - The timestamp when the policy was created.
- created
By Map<String> - Information about the entity that created the policy.
- description String
- A description of the VM-VM Anti-Affinity policy.
- ext
Id String - id String
- The provider-assigned unique ID for this managed resource.
- name String
- The name of the VM-VM Anti-Affinity policy.
- num
Compliant NumberVms - Number of compliant VMs which are part of the VM-VM anti-affinity policy.
- num
Non NumberCompliant Vms - Number of non-compliant VMs which are part of the VM-VM anti-affinity policy.
- num
Pending NumberVms - Number of VMs with compliance state as pending, which are part of the VM-VM anti-affinity policy.
- update
Time String - The timestamp when the policy was last updated.
- updated
By Map<String> - Information about the entity that last updated the policy.
Package Details
- Repository
- nutanix pierskarsenbarg/pulumi-nutanix
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
nutanixTerraform Provider.
Viewing docs for Nutanix v0.16.0
published on Tuesday, May 26, 2026 by Piers Karsenbarg
published on Tuesday, May 26, 2026 by Piers Karsenbarg