netbox.VirtualMachine
Explore with Pulumi AI
From the official documentation:
A virtual machine is a virtualized compute instance. These behave in NetBox very similarly to device objects, but without any physical attributes. For example, a VM may have interfaces assigned to it with IP addresses and VLANs, however its interfaces cannot be connected via cables (because they are virtual). Each VM may also define its compute, memory, and storage resources as well.
Create VirtualMachine Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new VirtualMachine(name: string, args?: VirtualMachineArgs, opts?: CustomResourceOptions);
@overload
def VirtualMachine(resource_name: str,
args: Optional[VirtualMachineArgs] = None,
opts: Optional[ResourceOptions] = None)
@overload
def VirtualMachine(resource_name: str,
opts: Optional[ResourceOptions] = None,
cluster_id: Optional[float] = None,
comments: Optional[str] = None,
custom_fields: Optional[Mapping[str, str]] = None,
description: Optional[str] = None,
device_id: Optional[float] = None,
disk_size_mb: Optional[float] = None,
local_context_data: Optional[str] = None,
memory_mb: Optional[float] = None,
name: Optional[str] = None,
platform_id: Optional[float] = None,
role_id: Optional[float] = None,
site_id: Optional[float] = None,
status: Optional[str] = None,
tags: Optional[Sequence[str]] = None,
tenant_id: Optional[float] = None,
vcpus: Optional[float] = None,
virtual_machine_id: Optional[str] = None)
func NewVirtualMachine(ctx *Context, name string, args *VirtualMachineArgs, opts ...ResourceOption) (*VirtualMachine, error)
public VirtualMachine(string name, VirtualMachineArgs? args = null, CustomResourceOptions? opts = null)
public VirtualMachine(String name, VirtualMachineArgs args)
public VirtualMachine(String name, VirtualMachineArgs args, CustomResourceOptions options)
type: netbox:VirtualMachine
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args VirtualMachineArgs
- 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 VirtualMachineArgs
- 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 VirtualMachineArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args VirtualMachineArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args VirtualMachineArgs
- 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 virtualMachineResource = new Netbox.VirtualMachine("virtualMachineResource", new()
{
ClusterId = 0,
Comments = "string",
CustomFields =
{
{ "string", "string" },
},
Description = "string",
DeviceId = 0,
DiskSizeMb = 0,
LocalContextData = "string",
MemoryMb = 0,
Name = "string",
PlatformId = 0,
RoleId = 0,
SiteId = 0,
Status = "string",
Tags = new[]
{
"string",
},
TenantId = 0,
Vcpus = 0,
VirtualMachineId = "string",
});
example, err := netbox.NewVirtualMachine(ctx, "virtualMachineResource", &netbox.VirtualMachineArgs{
ClusterId: pulumi.Float64(0),
Comments: pulumi.String("string"),
CustomFields: pulumi.StringMap{
"string": pulumi.String("string"),
},
Description: pulumi.String("string"),
DeviceId: pulumi.Float64(0),
DiskSizeMb: pulumi.Float64(0),
LocalContextData: pulumi.String("string"),
MemoryMb: pulumi.Float64(0),
Name: pulumi.String("string"),
PlatformId: pulumi.Float64(0),
RoleId: pulumi.Float64(0),
SiteId: pulumi.Float64(0),
Status: pulumi.String("string"),
Tags: pulumi.StringArray{
pulumi.String("string"),
},
TenantId: pulumi.Float64(0),
Vcpus: pulumi.Float64(0),
VirtualMachineId: pulumi.String("string"),
})
var virtualMachineResource = new VirtualMachine("virtualMachineResource", VirtualMachineArgs.builder()
.clusterId(0)
.comments("string")
.customFields(Map.of("string", "string"))
.description("string")
.deviceId(0)
.diskSizeMb(0)
.localContextData("string")
.memoryMb(0)
.name("string")
.platformId(0)
.roleId(0)
.siteId(0)
.status("string")
.tags("string")
.tenantId(0)
.vcpus(0)
.virtualMachineId("string")
.build());
virtual_machine_resource = netbox.VirtualMachine("virtualMachineResource",
cluster_id=0,
comments="string",
custom_fields={
"string": "string",
},
description="string",
device_id=0,
disk_size_mb=0,
local_context_data="string",
memory_mb=0,
name="string",
platform_id=0,
role_id=0,
site_id=0,
status="string",
tags=["string"],
tenant_id=0,
vcpus=0,
virtual_machine_id="string")
const virtualMachineResource = new netbox.VirtualMachine("virtualMachineResource", {
clusterId: 0,
comments: "string",
customFields: {
string: "string",
},
description: "string",
deviceId: 0,
diskSizeMb: 0,
localContextData: "string",
memoryMb: 0,
name: "string",
platformId: 0,
roleId: 0,
siteId: 0,
status: "string",
tags: ["string"],
tenantId: 0,
vcpus: 0,
virtualMachineId: "string",
});
type: netbox:VirtualMachine
properties:
clusterId: 0
comments: string
customFields:
string: string
description: string
deviceId: 0
diskSizeMb: 0
localContextData: string
memoryMb: 0
name: string
platformId: 0
roleId: 0
siteId: 0
status: string
tags:
- string
tenantId: 0
vcpus: 0
virtualMachineId: string
VirtualMachine 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 VirtualMachine resource accepts the following input properties:
- Cluster
Id double - At least one of
site_id
orcluster_id
must be given. - Comments string
- Custom
Fields Dictionary<string, string> - Description string
- Device
Id double - Disk
Size doubleMb - Local
Context stringData - This is best managed through the use of
jsonencode
and a map of settings. - Memory
Mb double - Name string
- Platform
Id double - Role
Id double - Site
Id double - At least one of
site_id
orcluster_id
must be given. - Status string
- Valid values are
offline
,active
,planned
,staged
,failed
anddecommissioning
. Defaults toactive
. - List<string>
- Tenant
Id double - Vcpus double
- Virtual
Machine stringId - The ID of this resource.
- Cluster
Id float64 - At least one of
site_id
orcluster_id
must be given. - Comments string
- Custom
Fields map[string]string - Description string
- Device
Id float64 - Disk
Size float64Mb - Local
Context stringData - This is best managed through the use of
jsonencode
and a map of settings. - Memory
Mb float64 - Name string
- Platform
Id float64 - Role
Id float64 - Site
Id float64 - At least one of
site_id
orcluster_id
must be given. - Status string
- Valid values are
offline
,active
,planned
,staged
,failed
anddecommissioning
. Defaults toactive
. - []string
- Tenant
Id float64 - Vcpus float64
- Virtual
Machine stringId - The ID of this resource.
- cluster
Id Double - At least one of
site_id
orcluster_id
must be given. - comments String
- custom
Fields Map<String,String> - description String
- device
Id Double - disk
Size DoubleMb - local
Context StringData - This is best managed through the use of
jsonencode
and a map of settings. - memory
Mb Double - name String
- platform
Id Double - role
Id Double - site
Id Double - At least one of
site_id
orcluster_id
must be given. - status String
- Valid values are
offline
,active
,planned
,staged
,failed
anddecommissioning
. Defaults toactive
. - List<String>
- tenant
Id Double - vcpus Double
- virtual
Machine StringId - The ID of this resource.
- cluster
Id number - At least one of
site_id
orcluster_id
must be given. - comments string
- custom
Fields {[key: string]: string} - description string
- device
Id number - disk
Size numberMb - local
Context stringData - This is best managed through the use of
jsonencode
and a map of settings. - memory
Mb number - name string
- platform
Id number - role
Id number - site
Id number - At least one of
site_id
orcluster_id
must be given. - status string
- Valid values are
offline
,active
,planned
,staged
,failed
anddecommissioning
. Defaults toactive
. - string[]
- tenant
Id number - vcpus number
- virtual
Machine stringId - The ID of this resource.
- cluster_
id float - At least one of
site_id
orcluster_id
must be given. - comments str
- custom_
fields Mapping[str, str] - description str
- device_
id float - disk_
size_ floatmb - local_
context_ strdata - This is best managed through the use of
jsonencode
and a map of settings. - memory_
mb float - name str
- platform_
id float - role_
id float - site_
id float - At least one of
site_id
orcluster_id
must be given. - status str
- Valid values are
offline
,active
,planned
,staged
,failed
anddecommissioning
. Defaults toactive
. - Sequence[str]
- tenant_
id float - vcpus float
- virtual_
machine_ strid - The ID of this resource.
- cluster
Id Number - At least one of
site_id
orcluster_id
must be given. - comments String
- custom
Fields Map<String> - description String
- device
Id Number - disk
Size NumberMb - local
Context StringData - This is best managed through the use of
jsonencode
and a map of settings. - memory
Mb Number - name String
- platform
Id Number - role
Id Number - site
Id Number - At least one of
site_id
orcluster_id
must be given. - status String
- Valid values are
offline
,active
,planned
,staged
,failed
anddecommissioning
. Defaults toactive
. - List<String>
- tenant
Id Number - vcpus Number
- virtual
Machine StringId - The ID of this resource.
Outputs
All input properties are implicitly available as output properties. Additionally, the VirtualMachine resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Primary
Ipv4 double - Primary
Ipv6 double
- Id string
- The provider-assigned unique ID for this managed resource.
- Primary
Ipv4 float64 - Primary
Ipv6 float64
- id String
- The provider-assigned unique ID for this managed resource.
- primary
Ipv4 Double - primary
Ipv6 Double
- id string
- The provider-assigned unique ID for this managed resource.
- primary
Ipv4 number - primary
Ipv6 number
- id str
- The provider-assigned unique ID for this managed resource.
- primary_
ipv4 float - primary_
ipv6 float
- id String
- The provider-assigned unique ID for this managed resource.
- primary
Ipv4 Number - primary
Ipv6 Number
Look up Existing VirtualMachine Resource
Get an existing VirtualMachine 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?: VirtualMachineState, opts?: CustomResourceOptions): VirtualMachine
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
cluster_id: Optional[float] = None,
comments: Optional[str] = None,
custom_fields: Optional[Mapping[str, str]] = None,
description: Optional[str] = None,
device_id: Optional[float] = None,
disk_size_mb: Optional[float] = None,
local_context_data: Optional[str] = None,
memory_mb: Optional[float] = None,
name: Optional[str] = None,
platform_id: Optional[float] = None,
primary_ipv4: Optional[float] = None,
primary_ipv6: Optional[float] = None,
role_id: Optional[float] = None,
site_id: Optional[float] = None,
status: Optional[str] = None,
tags: Optional[Sequence[str]] = None,
tenant_id: Optional[float] = None,
vcpus: Optional[float] = None,
virtual_machine_id: Optional[str] = None) -> VirtualMachine
func GetVirtualMachine(ctx *Context, name string, id IDInput, state *VirtualMachineState, opts ...ResourceOption) (*VirtualMachine, error)
public static VirtualMachine Get(string name, Input<string> id, VirtualMachineState? state, CustomResourceOptions? opts = null)
public static VirtualMachine get(String name, Output<String> id, VirtualMachineState state, CustomResourceOptions options)
resources: _: type: netbox:VirtualMachine get: 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.
- Cluster
Id double - At least one of
site_id
orcluster_id
must be given. - Comments string
- Custom
Fields Dictionary<string, string> - Description string
- Device
Id double - Disk
Size doubleMb - Local
Context stringData - This is best managed through the use of
jsonencode
and a map of settings. - Memory
Mb double - Name string
- Platform
Id double - Primary
Ipv4 double - Primary
Ipv6 double - Role
Id double - Site
Id double - At least one of
site_id
orcluster_id
must be given. - Status string
- Valid values are
offline
,active
,planned
,staged
,failed
anddecommissioning
. Defaults toactive
. - List<string>
- Tenant
Id double - Vcpus double
- Virtual
Machine stringId - The ID of this resource.
- Cluster
Id float64 - At least one of
site_id
orcluster_id
must be given. - Comments string
- Custom
Fields map[string]string - Description string
- Device
Id float64 - Disk
Size float64Mb - Local
Context stringData - This is best managed through the use of
jsonencode
and a map of settings. - Memory
Mb float64 - Name string
- Platform
Id float64 - Primary
Ipv4 float64 - Primary
Ipv6 float64 - Role
Id float64 - Site
Id float64 - At least one of
site_id
orcluster_id
must be given. - Status string
- Valid values are
offline
,active
,planned
,staged
,failed
anddecommissioning
. Defaults toactive
. - []string
- Tenant
Id float64 - Vcpus float64
- Virtual
Machine stringId - The ID of this resource.
- cluster
Id Double - At least one of
site_id
orcluster_id
must be given. - comments String
- custom
Fields Map<String,String> - description String
- device
Id Double - disk
Size DoubleMb - local
Context StringData - This is best managed through the use of
jsonencode
and a map of settings. - memory
Mb Double - name String
- platform
Id Double - primary
Ipv4 Double - primary
Ipv6 Double - role
Id Double - site
Id Double - At least one of
site_id
orcluster_id
must be given. - status String
- Valid values are
offline
,active
,planned
,staged
,failed
anddecommissioning
. Defaults toactive
. - List<String>
- tenant
Id Double - vcpus Double
- virtual
Machine StringId - The ID of this resource.
- cluster
Id number - At least one of
site_id
orcluster_id
must be given. - comments string
- custom
Fields {[key: string]: string} - description string
- device
Id number - disk
Size numberMb - local
Context stringData - This is best managed through the use of
jsonencode
and a map of settings. - memory
Mb number - name string
- platform
Id number - primary
Ipv4 number - primary
Ipv6 number - role
Id number - site
Id number - At least one of
site_id
orcluster_id
must be given. - status string
- Valid values are
offline
,active
,planned
,staged
,failed
anddecommissioning
. Defaults toactive
. - string[]
- tenant
Id number - vcpus number
- virtual
Machine stringId - The ID of this resource.
- cluster_
id float - At least one of
site_id
orcluster_id
must be given. - comments str
- custom_
fields Mapping[str, str] - description str
- device_
id float - disk_
size_ floatmb - local_
context_ strdata - This is best managed through the use of
jsonencode
and a map of settings. - memory_
mb float - name str
- platform_
id float - primary_
ipv4 float - primary_
ipv6 float - role_
id float - site_
id float - At least one of
site_id
orcluster_id
must be given. - status str
- Valid values are
offline
,active
,planned
,staged
,failed
anddecommissioning
. Defaults toactive
. - Sequence[str]
- tenant_
id float - vcpus float
- virtual_
machine_ strid - The ID of this resource.
- cluster
Id Number - At least one of
site_id
orcluster_id
must be given. - comments String
- custom
Fields Map<String> - description String
- device
Id Number - disk
Size NumberMb - local
Context StringData - This is best managed through the use of
jsonencode
and a map of settings. - memory
Mb Number - name String
- platform
Id Number - primary
Ipv4 Number - primary
Ipv6 Number - role
Id Number - site
Id Number - At least one of
site_id
orcluster_id
must be given. - status String
- Valid values are
offline
,active
,planned
,staged
,failed
anddecommissioning
. Defaults toactive
. - List<String>
- tenant
Id Number - vcpus Number
- virtual
Machine StringId - The ID of this resource.
Package Details
- Repository
- netbox e-breuninger/terraform-provider-netbox
- License
- Notes
- This Pulumi package is based on the
netbox
Terraform Provider.