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-Host 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.getVmHostAffinityPolicyV2({
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_host_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.GetVmHostAffinityPolicyV2(ctx, &nutanix.LookupVmHostAffinityPolicyV2Args{
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.GetVmHostAffinityPolicyV2.Invoke(new()
{
ExtId = "12345678-1234-1234-1234-123456789012",
});
return new Dictionary<string, object?>
{
["policyName"] = policy.Apply(getVmHostAffinityPolicyV2Result => getVmHostAffinityPolicyV2Result.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.GetVmHostAffinityPolicyV2Args;
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.getVmHostAffinityPolicyV2(GetVmHostAffinityPolicyV2Args.builder()
.extId("12345678-1234-1234-1234-123456789012")
.build());
ctx.export("policyName", policy.name());
}
}
variables:
policy:
fn::invoke:
function: nutanix:getVmHostAffinityPolicyV2
arguments:
extId: 12345678-1234-1234-1234-123456789012
outputs:
policyName: ${policy.name}
pulumi {
required_providers {
nutanix = {
source = "pulumi/nutanix"
}
}
}
data "nutanix_getvmhostaffinitypolicyv2" "policy" {
ext_id = "12345678-1234-1234-1234-123456789012"
}
output "policyName" {
value = data.nutanix_getvmhostaffinitypolicyv2.policy.name
}
Using getVmHostAffinityPolicyV2
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 getVmHostAffinityPolicyV2(args: GetVmHostAffinityPolicyV2Args, opts?: InvokeOptions): Promise<GetVmHostAffinityPolicyV2Result>
function getVmHostAffinityPolicyV2Output(args: GetVmHostAffinityPolicyV2OutputArgs, opts?: InvokeOptions): Output<GetVmHostAffinityPolicyV2Result>def get_vm_host_affinity_policy_v2(ext_id: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetVmHostAffinityPolicyV2Result
def get_vm_host_affinity_policy_v2_output(ext_id: pulumi.Input[Optional[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetVmHostAffinityPolicyV2Result]func LookupVmHostAffinityPolicyV2(ctx *Context, args *LookupVmHostAffinityPolicyV2Args, opts ...InvokeOption) (*LookupVmHostAffinityPolicyV2Result, error)
func LookupVmHostAffinityPolicyV2Output(ctx *Context, args *LookupVmHostAffinityPolicyV2OutputArgs, opts ...InvokeOption) LookupVmHostAffinityPolicyV2ResultOutput> Note: This function is named LookupVmHostAffinityPolicyV2 in the Go SDK.
public static class GetVmHostAffinityPolicyV2
{
public static Task<GetVmHostAffinityPolicyV2Result> InvokeAsync(GetVmHostAffinityPolicyV2Args args, InvokeOptions? opts = null)
public static Output<GetVmHostAffinityPolicyV2Result> Invoke(GetVmHostAffinityPolicyV2InvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetVmHostAffinityPolicyV2Result> getVmHostAffinityPolicyV2(GetVmHostAffinityPolicyV2Args args, InvokeOptions options)
public static Output<GetVmHostAffinityPolicyV2Result> getVmHostAffinityPolicyV2(GetVmHostAffinityPolicyV2Args args, InvokeOptions options)
fn::invoke:
function: nutanix:index/getVmHostAffinityPolicyV2:getVmHostAffinityPolicyV2
arguments:
# arguments dictionarydata "nutanix_getvmhostaffinitypolicyv2" "name" {
# arguments
}The following arguments are supported:
- Ext
Id string - The external identifier of a VM-Host Affinity policy.
- Ext
Id string - The external identifier of a VM-Host Affinity policy.
- ext_
id string - The external identifier of a VM-Host Affinity policy.
- ext
Id String - The external identifier of a VM-Host Affinity policy.
- ext
Id string - The external identifier of a VM-Host Affinity policy.
- ext_
id str - The external identifier of a VM-Host Affinity policy.
- ext
Id String - The external identifier of a VM-Host Affinity policy.
getVmHostAffinityPolicyV2 Result
The following output properties are available:
- 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-Host Affinity policy.
- Ext
Id string - Host
Categories List<string> - List of host category external IDs that define where the VMs can be placed.
- Id string
- The provider-assigned unique ID for this managed resource.
- Last
Updated Dictionary<string, string>By - Information about the entity that last updated the policy.
- Name string
- The name of the VM-Host Affinity policy.
- Num
Compliant intVms - Number of VMs which are compliant with the VM-host affinity policy.
- Num
Hosts int - Number of hosts associated with the VM-host affinity policy.
- Num
Non intCompliant Vms - Number of VMs which are not compliant with the VM-host affinity policy.
- Num
Vms int - Number of VMs associated with the VM-host affinity policy.
- Update
Time string - The timestamp when the policy was last updated.
- Vm
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-Host Affinity policy.
- Ext
Id string - Host
Categories []string - List of host category external IDs that define where the VMs can be placed.
- Id string
- The provider-assigned unique ID for this managed resource.
- Last
Updated map[string]stringBy - Information about the entity that last updated the policy.
- Name string
- The name of the VM-Host Affinity policy.
- Num
Compliant intVms - Number of VMs which are compliant with the VM-host affinity policy.
- Num
Hosts int - Number of hosts associated with the VM-host affinity policy.
- Num
Non intCompliant Vms - Number of VMs which are not compliant with the VM-host affinity policy.
- Num
Vms int - Number of VMs associated with the VM-host affinity policy.
- Update
Time string - The timestamp when the policy was last updated.
- Vm
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) - Information about the entity that created the policy.
- description string
- A description of the VM-Host Affinity policy.
- ext_
id string - host_
categories list(string) - List of host category external IDs that define where the VMs can be placed.
- id string
- The provider-assigned unique ID for this managed resource.
- last_
updated_ map(string)by - Information about the entity that last updated the policy.
- name string
- The name of the VM-Host Affinity policy.
- num_
compliant_ numbervms - Number of VMs which are compliant with the VM-host affinity policy.
- num_
hosts number - Number of hosts associated with the VM-host affinity policy.
- num_
non_ numbercompliant_ vms - Number of VMs which are not compliant with the VM-host affinity policy.
- num_
vms number - Number of VMs associated with the VM-host affinity policy.
- update_
time string - The timestamp when the policy was last updated.
- vm_
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-Host Affinity policy.
- ext
Id String - host
Categories List<String> - List of host category external IDs that define where the VMs can be placed.
- id String
- The provider-assigned unique ID for this managed resource.
- last
Updated Map<String,String>By - Information about the entity that last updated the policy.
- name String
- The name of the VM-Host Affinity policy.
- num
Compliant IntegerVms - Number of VMs which are compliant with the VM-host affinity policy.
- num
Hosts Integer - Number of hosts associated with the VM-host affinity policy.
- num
Non IntegerCompliant Vms - Number of VMs which are not compliant with the VM-host affinity policy.
- num
Vms Integer - Number of VMs associated with the VM-host affinity policy.
- update
Time String - The timestamp when the policy was last updated.
- vm
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 {[key: string]: string} - Information about the entity that created the policy.
- description string
- A description of the VM-Host Affinity policy.
- ext
Id string - host
Categories string[] - List of host category external IDs that define where the VMs can be placed.
- id string
- The provider-assigned unique ID for this managed resource.
- last
Updated {[key: string]: string}By - Information about the entity that last updated the policy.
- name string
- The name of the VM-Host Affinity policy.
- num
Compliant numberVms - Number of VMs which are compliant with the VM-host affinity policy.
- num
Hosts number - Number of hosts associated with the VM-host affinity policy.
- num
Non numberCompliant Vms - Number of VMs which are not compliant with the VM-host affinity policy.
- num
Vms number - Number of VMs associated with the VM-host affinity policy.
- update
Time string - The timestamp when the policy was last updated.
- vm
Categories string[] - 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-Host Affinity policy.
- ext_
id str - host_
categories Sequence[str] - List of host category external IDs that define where the VMs can be placed.
- id str
- The provider-assigned unique ID for this managed resource.
- last_
updated_ Mapping[str, str]by - Information about the entity that last updated the policy.
- name str
- The name of the VM-Host Affinity policy.
- num_
compliant_ intvms - Number of VMs which are compliant with the VM-host affinity policy.
- num_
hosts int - Number of hosts associated with the VM-host affinity policy.
- num_
non_ intcompliant_ vms - Number of VMs which are not compliant with the VM-host affinity policy.
- num_
vms int - Number of VMs associated with the VM-host affinity policy.
- update_
time str - The timestamp when the policy was last updated.
- vm_
categories Sequence[str] - 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-Host Affinity policy.
- ext
Id String - host
Categories List<String> - List of host category external IDs that define where the VMs can be placed.
- id String
- The provider-assigned unique ID for this managed resource.
- last
Updated Map<String>By - Information about the entity that last updated the policy.
- name String
- The name of the VM-Host Affinity policy.
- num
Compliant NumberVms - Number of VMs which are compliant with the VM-host affinity policy.
- num
Hosts Number - Number of hosts associated with the VM-host affinity policy.
- num
Non NumberCompliant Vms - Number of VMs which are not compliant with the VM-host affinity policy.
- num
Vms Number - Number of VMs associated with the VM-host affinity policy.
- update
Time String - The timestamp when the policy was last updated.
- vm
Categories List<String> - List of VM category external IDs that this policy applies to.
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