published on Thursday, Jun 25, 2026 by Pulumi
published on Thursday, Jun 25, 2026 by Pulumi
Provides a resource for configuring vSphere Namespaces.
Example Usage
S
Create a namespace
import * as pulumi from "@pulumi/pulumi";
import * as vsphere from "@pulumi/vsphere";
const example = new vsphere.Namespace("example", {
name: "example-namespace",
supervisor: "ff69d7fb-4ad4-44a2-8d91-8b3bede80eaa",
vmServices: [{
contentLibraries: ["ca616f93-506d-4f00-98bf-7708d30f68bc"],
vmClasses: ["example-vm-class"],
}],
storagePolicies: ["1bb87d1e-49a5-49f8-ad4a-7094be13d4a0"],
});
import pulumi
import pulumi_vsphere as vsphere
example = vsphere.Namespace("example",
name="example-namespace",
supervisor="ff69d7fb-4ad4-44a2-8d91-8b3bede80eaa",
vm_services=[{
"content_libraries": ["ca616f93-506d-4f00-98bf-7708d30f68bc"],
"vm_classes": ["example-vm-class"],
}],
storage_policies=["1bb87d1e-49a5-49f8-ad4a-7094be13d4a0"])
package main
import (
"github.com/pulumi/pulumi-vsphere/sdk/v4/go/vsphere"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := vsphere.NewNamespace(ctx, "example", &vsphere.NamespaceArgs{
Name: pulumi.String("example-namespace"),
Supervisor: pulumi.String("ff69d7fb-4ad4-44a2-8d91-8b3bede80eaa"),
VmServices: vsphere.NamespaceVmServiceArray{
&vsphere.NamespaceVmServiceArgs{
ContentLibraries: pulumi.StringArray{
pulumi.String("ca616f93-506d-4f00-98bf-7708d30f68bc"),
},
VmClasses: pulumi.StringArray{
pulumi.String("example-vm-class"),
},
},
},
StoragePolicies: pulumi.StringArray{
pulumi.String("1bb87d1e-49a5-49f8-ad4a-7094be13d4a0"),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using VSphere = Pulumi.VSphere;
return await Deployment.RunAsync(() =>
{
var example = new VSphere.Namespace("example", new()
{
Name = "example-namespace",
Supervisor = "ff69d7fb-4ad4-44a2-8d91-8b3bede80eaa",
VmServices = new[]
{
new VSphere.Inputs.NamespaceVmServiceArgs
{
ContentLibraries = new[]
{
"ca616f93-506d-4f00-98bf-7708d30f68bc",
},
VmClasses = new[]
{
"example-vm-class",
},
},
},
StoragePolicies = new[]
{
"1bb87d1e-49a5-49f8-ad4a-7094be13d4a0",
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.vsphere.Namespace;
import com.pulumi.vsphere.NamespaceArgs;
import com.pulumi.vsphere.inputs.NamespaceVmServiceArgs;
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) {
var example = new Namespace("example", NamespaceArgs.builder()
.name("example-namespace")
.supervisor("ff69d7fb-4ad4-44a2-8d91-8b3bede80eaa")
.vmServices(NamespaceVmServiceArgs.builder()
.contentLibraries("ca616f93-506d-4f00-98bf-7708d30f68bc")
.vmClasses("example-vm-class")
.build())
.storagePolicies("1bb87d1e-49a5-49f8-ad4a-7094be13d4a0")
.build());
}
}
resources:
example:
type: vsphere:Namespace
properties:
name: example-namespace
supervisor: ff69d7fb-4ad4-44a2-8d91-8b3bede80eaa
vmServices:
- contentLibraries:
- ca616f93-506d-4f00-98bf-7708d30f68bc
vmClasses:
- example-vm-class
storagePolicies:
- 1bb87d1e-49a5-49f8-ad4a-7094be13d4a0
pulumi {
required_providers {
vsphere = {
source = "pulumi/vsphere"
}
}
}
resource "vsphere_namespace" "example" {
name = "example-namespace"
supervisor = "ff69d7fb-4ad4-44a2-8d91-8b3bede80eaa"
vm_services {
content_libraries = ["ca616f93-506d-4f00-98bf-7708d30f68bc"]
vm_classes = ["example-vm-class"]
}
storage_policies = ["1bb87d1e-49a5-49f8-ad4a-7094be13d4a0"]
}
Create Namespace Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Namespace(name: string, args: NamespaceArgs, opts?: CustomResourceOptions);@overload
def Namespace(resource_name: str,
args: NamespaceArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Namespace(resource_name: str,
opts: Optional[ResourceOptions] = None,
supervisor: Optional[str] = None,
name: Optional[str] = None,
storage_policies: Optional[Sequence[str]] = None,
vm_services: Optional[Sequence[NamespaceVmServiceArgs]] = None)func NewNamespace(ctx *Context, name string, args NamespaceArgs, opts ...ResourceOption) (*Namespace, error)public Namespace(string name, NamespaceArgs args, CustomResourceOptions? opts = null)
public Namespace(String name, NamespaceArgs args)
public Namespace(String name, NamespaceArgs args, CustomResourceOptions options)
type: vsphere:Namespace
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
resource "vsphere_namespace" "name" {
# resource properties
}Parameters
- name string
- The unique name of the resource.
- args NamespaceArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args NamespaceArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args NamespaceArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args NamespaceArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args NamespaceArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var namespaceResource = new VSphere.Namespace("namespaceResource", new()
{
Supervisor = "string",
Name = "string",
StoragePolicies = new[]
{
"string",
},
VmServices = new[]
{
new VSphere.Inputs.NamespaceVmServiceArgs
{
ContentLibraries = new[]
{
"string",
},
VmClasses = new[]
{
"string",
},
},
},
});
example, err := vsphere.NewNamespace(ctx, "namespaceResource", &vsphere.NamespaceArgs{
Supervisor: pulumi.String("string"),
Name: pulumi.String("string"),
StoragePolicies: pulumi.StringArray{
pulumi.String("string"),
},
VmServices: vsphere.NamespaceVmServiceArray{
&vsphere.NamespaceVmServiceArgs{
ContentLibraries: pulumi.StringArray{
pulumi.String("string"),
},
VmClasses: pulumi.StringArray{
pulumi.String("string"),
},
},
},
})
resource "vsphere_namespace" "namespaceResource" {
supervisor = "string"
name = "string"
storage_policies = ["string"]
vm_services {
content_libraries = ["string"]
vm_classes = ["string"]
}
}
var namespaceResource = new Namespace("namespaceResource", NamespaceArgs.builder()
.supervisor("string")
.name("string")
.storagePolicies("string")
.vmServices(NamespaceVmServiceArgs.builder()
.contentLibraries("string")
.vmClasses("string")
.build())
.build());
namespace_resource = vsphere.Namespace("namespaceResource",
supervisor="string",
name="string",
storage_policies=["string"],
vm_services=[{
"content_libraries": ["string"],
"vm_classes": ["string"],
}])
const namespaceResource = new vsphere.Namespace("namespaceResource", {
supervisor: "string",
name: "string",
storagePolicies: ["string"],
vmServices: [{
contentLibraries: ["string"],
vmClasses: ["string"],
}],
});
type: vsphere:Namespace
properties:
name: string
storagePolicies:
- string
supervisor: string
vmServices:
- contentLibraries:
- string
vmClasses:
- string
Namespace Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The Namespace resource accepts the following input properties:
- Supervisor string
- The identifier of the vSphere Supervisor managing the namespace.
- Name string
- The name of the vSphere namespace.
- Storage
Policies List<string> - The list of storage policies that will be available in the vSphere Namespace.
- Vm
Services List<Pulumi.VSphere. Inputs. Namespace Vm Service> - The configuration for VM Service in the vSphere Namespace.
- Supervisor string
- The identifier of the vSphere Supervisor managing the namespace.
- Name string
- The name of the vSphere namespace.
- Storage
Policies []string - The list of storage policies that will be available in the vSphere Namespace.
- Vm
Services []NamespaceVm Service Args - The configuration for VM Service in the vSphere Namespace.
- supervisor string
- The identifier of the vSphere Supervisor managing the namespace.
- name string
- The name of the vSphere namespace.
- storage_
policies list(string) - The list of storage policies that will be available in the vSphere Namespace.
- vm_
services list(object) - The configuration for VM Service in the vSphere Namespace.
- supervisor String
- The identifier of the vSphere Supervisor managing the namespace.
- name String
- The name of the vSphere namespace.
- storage
Policies List<String> - The list of storage policies that will be available in the vSphere Namespace.
- vm
Services List<NamespaceVm Service> - The configuration for VM Service in the vSphere Namespace.
- supervisor string
- The identifier of the vSphere Supervisor managing the namespace.
- name string
- The name of the vSphere namespace.
- storage
Policies string[] - The list of storage policies that will be available in the vSphere Namespace.
- vm
Services NamespaceVm Service[] - The configuration for VM Service in the vSphere Namespace.
- supervisor str
- The identifier of the vSphere Supervisor managing the namespace.
- name str
- The name of the vSphere namespace.
- storage_
policies Sequence[str] - The list of storage policies that will be available in the vSphere Namespace.
- vm_
services Sequence[NamespaceVm Service Args] - The configuration for VM Service in the vSphere Namespace.
- supervisor String
- The identifier of the vSphere Supervisor managing the namespace.
- name String
- The name of the vSphere namespace.
- storage
Policies List<String> - The list of storage policies that will be available in the vSphere Namespace.
- vm
Services List<Property Map> - The configuration for VM Service in the vSphere Namespace.
Outputs
All input properties are implicitly available as output properties. Additionally, the Namespace resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing Namespace Resource
Get an existing Namespace resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: NamespaceState, opts?: CustomResourceOptions): Namespace@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
name: Optional[str] = None,
storage_policies: Optional[Sequence[str]] = None,
supervisor: Optional[str] = None,
vm_services: Optional[Sequence[NamespaceVmServiceArgs]] = None) -> Namespacefunc GetNamespace(ctx *Context, name string, id IDInput, state *NamespaceState, opts ...ResourceOption) (*Namespace, error)public static Namespace Get(string name, Input<string> id, NamespaceState? state, CustomResourceOptions? opts = null)public static Namespace get(String name, Output<String> id, NamespaceState state, CustomResourceOptions options)resources: _: type: vsphere:Namespace get: id: ${id}import {
to = vsphere_namespace.example
id = "${id}"
}
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Name string
- The name of the vSphere namespace.
- Storage
Policies List<string> - The list of storage policies that will be available in the vSphere Namespace.
- Supervisor string
- The identifier of the vSphere Supervisor managing the namespace.
- Vm
Services List<Pulumi.VSphere. Inputs. Namespace Vm Service> - The configuration for VM Service in the vSphere Namespace.
- Name string
- The name of the vSphere namespace.
- Storage
Policies []string - The list of storage policies that will be available in the vSphere Namespace.
- Supervisor string
- The identifier of the vSphere Supervisor managing the namespace.
- Vm
Services []NamespaceVm Service Args - The configuration for VM Service in the vSphere Namespace.
- name string
- The name of the vSphere namespace.
- storage_
policies list(string) - The list of storage policies that will be available in the vSphere Namespace.
- supervisor string
- The identifier of the vSphere Supervisor managing the namespace.
- vm_
services list(object) - The configuration for VM Service in the vSphere Namespace.
- name String
- The name of the vSphere namespace.
- storage
Policies List<String> - The list of storage policies that will be available in the vSphere Namespace.
- supervisor String
- The identifier of the vSphere Supervisor managing the namespace.
- vm
Services List<NamespaceVm Service> - The configuration for VM Service in the vSphere Namespace.
- name string
- The name of the vSphere namespace.
- storage
Policies string[] - The list of storage policies that will be available in the vSphere Namespace.
- supervisor string
- The identifier of the vSphere Supervisor managing the namespace.
- vm
Services NamespaceVm Service[] - The configuration for VM Service in the vSphere Namespace.
- name str
- The name of the vSphere namespace.
- storage_
policies Sequence[str] - The list of storage policies that will be available in the vSphere Namespace.
- supervisor str
- The identifier of the vSphere Supervisor managing the namespace.
- vm_
services Sequence[NamespaceVm Service Args] - The configuration for VM Service in the vSphere Namespace.
- name String
- The name of the vSphere namespace.
- storage
Policies List<String> - The list of storage policies that will be available in the vSphere Namespace.
- supervisor String
- The identifier of the vSphere Supervisor managing the namespace.
- vm
Services List<Property Map> - The configuration for VM Service in the vSphere Namespace.
Supporting Types
NamespaceVmService, NamespaceVmServiceArgs
- Content
Libraries List<string> - The list of content libraries to associate with the VM Service.
- Vm
Classes List<string> - The list of VM Classes to associate with the VM Service.
- Content
Libraries []string - The list of content libraries to associate with the VM Service.
- Vm
Classes []string - The list of VM Classes to associate with the VM Service.
- content_
libraries list(string) - The list of content libraries to associate with the VM Service.
- vm_
classes list(string) - The list of VM Classes to associate with the VM Service.
- content
Libraries List<String> - The list of content libraries to associate with the VM Service.
- vm
Classes List<String> - The list of VM Classes to associate with the VM Service.
- content
Libraries string[] - The list of content libraries to associate with the VM Service.
- vm
Classes string[] - The list of VM Classes to associate with the VM Service.
- content_
libraries Sequence[str] - The list of content libraries to associate with the VM Service.
- vm_
classes Sequence[str] - The list of VM Classes to associate with the VM Service.
- content
Libraries List<String> - The list of content libraries to associate with the VM Service.
- vm
Classes List<String> - The list of VM Classes to associate with the VM Service.
Package Details
- Repository
- vSphere pulumi/pulumi-vsphere
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
vsphereTerraform Provider.
published on Thursday, Jun 25, 2026 by Pulumi