opennebula 1.5.0 published on Friday, Jun 27, 2025 by opennebula
opennebula.getVirtualMachines
Explore with Pulumi AI
opennebula 1.5.0 published on Friday, Jun 27, 2025 by opennebula
Use this data source to retrieve virtual machines information.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as opennebula from "@pulumi/opennebula";
const example = opennebula.getVirtualMachines({
nameRegex: "test.*",
order: "ASC",
sortOn: "id",
});
import pulumi
import pulumi_opennebula as opennebula
example = opennebula.get_virtual_machines(name_regex="test.*",
order="ASC",
sort_on="id")
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/opennebula/opennebula"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := opennebula.GetVirtualMachines(ctx, &opennebula.GetVirtualMachinesArgs{
NameRegex: pulumi.StringRef("test.*"),
Order: pulumi.StringRef("ASC"),
SortOn: pulumi.StringRef("id"),
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Opennebula = Pulumi.Opennebula;
return await Deployment.RunAsync(() =>
{
var example = Opennebula.GetVirtualMachines.Invoke(new()
{
NameRegex = "test.*",
Order = "ASC",
SortOn = "id",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.opennebula.OpennebulaFunctions;
import com.pulumi.opennebula.inputs.GetVirtualMachinesArgs;
import java.util.List;
import java.util.ArrayList;
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 example = OpennebulaFunctions.getVirtualMachines(GetVirtualMachinesArgs.builder()
.nameRegex("test.*")
.order("ASC")
.sortOn("id")
.build());
}
}
variables:
example:
fn::invoke:
function: opennebula:getVirtualMachines
arguments:
nameRegex: test.*
order: ASC
sortOn: id
Virtual machines attributes
id
- ID of the virtual machine.name
- Name of the virtual machine.cpu
- Amount of CPU shares assigned to the VM.vcpu
- Number of CPU cores presented to the VM.memory
- Amount of RAM assigned to the VM in MB.disk
- Disk parameters.nic
- NIC parameters.nic_alias
- NIC Alias parameters.vmgroup
- VM group parameterstags
- Tags of the virtual machine (Key = Value).
Using getVirtualMachines
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 getVirtualMachines(args: GetVirtualMachinesArgs, opts?: InvokeOptions): Promise<GetVirtualMachinesResult>
function getVirtualMachinesOutput(args: GetVirtualMachinesOutputArgs, opts?: InvokeOptions): Output<GetVirtualMachinesResult>
def get_virtual_machines(cpu: Optional[float] = None,
id: Optional[str] = None,
memory: Optional[float] = None,
name_regex: Optional[str] = None,
order: Optional[str] = None,
sort_on: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None,
vcpu: Optional[float] = None,
opts: Optional[InvokeOptions] = None) -> GetVirtualMachinesResult
def get_virtual_machines_output(cpu: Optional[pulumi.Input[float]] = None,
id: Optional[pulumi.Input[str]] = None,
memory: Optional[pulumi.Input[float]] = None,
name_regex: Optional[pulumi.Input[str]] = None,
order: Optional[pulumi.Input[str]] = None,
sort_on: Optional[pulumi.Input[str]] = None,
tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
vcpu: Optional[pulumi.Input[float]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetVirtualMachinesResult]
func GetVirtualMachines(ctx *Context, args *GetVirtualMachinesArgs, opts ...InvokeOption) (*GetVirtualMachinesResult, error)
func GetVirtualMachinesOutput(ctx *Context, args *GetVirtualMachinesOutputArgs, opts ...InvokeOption) GetVirtualMachinesResultOutput
> Note: This function is named GetVirtualMachines
in the Go SDK.
public static class GetVirtualMachines
{
public static Task<GetVirtualMachinesResult> InvokeAsync(GetVirtualMachinesArgs args, InvokeOptions? opts = null)
public static Output<GetVirtualMachinesResult> Invoke(GetVirtualMachinesInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetVirtualMachinesResult> getVirtualMachines(GetVirtualMachinesArgs args, InvokeOptions options)
public static Output<GetVirtualMachinesResult> getVirtualMachines(GetVirtualMachinesArgs args, InvokeOptions options)
fn::invoke:
function: opennebula:index/getVirtualMachines:getVirtualMachines
arguments:
# arguments dictionary
The following arguments are supported:
- Cpu double
- Amount of CPU shares assigned to the VM.
- Id string
- Memory double
- Amount of RAM assigned to the VM in MB.
- Name
Regex string - Filter virtual machines by name with a RE2 regular expression.
- Order string
- Ordering of the sort: ASC or DESC.
- Sort
On string - Attribute used to sort the VMs list among:
id
,name
,cpu
,vcpu
,memory
. - Dictionary<string, string>
- virtual machine tags (Key = Value).
- Vcpu double
- Number of CPU cores presented to the VM.
- Cpu float64
- Amount of CPU shares assigned to the VM.
- Id string
- Memory float64
- Amount of RAM assigned to the VM in MB.
- Name
Regex string - Filter virtual machines by name with a RE2 regular expression.
- Order string
- Ordering of the sort: ASC or DESC.
- Sort
On string - Attribute used to sort the VMs list among:
id
,name
,cpu
,vcpu
,memory
. - map[string]string
- virtual machine tags (Key = Value).
- Vcpu float64
- Number of CPU cores presented to the VM.
- cpu Double
- Amount of CPU shares assigned to the VM.
- id String
- memory Double
- Amount of RAM assigned to the VM in MB.
- name
Regex String - Filter virtual machines by name with a RE2 regular expression.
- order String
- Ordering of the sort: ASC or DESC.
- sort
On String - Attribute used to sort the VMs list among:
id
,name
,cpu
,vcpu
,memory
. - Map<String,String>
- virtual machine tags (Key = Value).
- vcpu Double
- Number of CPU cores presented to the VM.
- cpu number
- Amount of CPU shares assigned to the VM.
- id string
- memory number
- Amount of RAM assigned to the VM in MB.
- name
Regex string - Filter virtual machines by name with a RE2 regular expression.
- order string
- Ordering of the sort: ASC or DESC.
- sort
On string - Attribute used to sort the VMs list among:
id
,name
,cpu
,vcpu
,memory
. - {[key: string]: string}
- virtual machine tags (Key = Value).
- vcpu number
- Number of CPU cores presented to the VM.
- cpu float
- Amount of CPU shares assigned to the VM.
- id str
- memory float
- Amount of RAM assigned to the VM in MB.
- name_
regex str - Filter virtual machines by name with a RE2 regular expression.
- order str
- Ordering of the sort: ASC or DESC.
- sort_
on str - Attribute used to sort the VMs list among:
id
,name
,cpu
,vcpu
,memory
. - Mapping[str, str]
- virtual machine tags (Key = Value).
- vcpu float
- Number of CPU cores presented to the VM.
- cpu Number
- Amount of CPU shares assigned to the VM.
- id String
- memory Number
- Amount of RAM assigned to the VM in MB.
- name
Regex String - Filter virtual machines by name with a RE2 regular expression.
- order String
- Ordering of the sort: ASC or DESC.
- sort
On String - Attribute used to sort the VMs list among:
id
,name
,cpu
,vcpu
,memory
. - Map<String>
- virtual machine tags (Key = Value).
- vcpu Number
- Number of CPU cores presented to the VM.
getVirtualMachines Result
The following output properties are available:
- Cpu double
- Id string
- Memory double
- Vcpu double
- Virtual
Machines List<GetVirtual Machines Virtual Machine> - For each filtered virtual machine, this section collect a list of attributes. See virtual-machines-attributes
- Name
Regex string - Order string
- Sort
On string - Dictionary<string, string>
- Cpu float64
- Id string
- Memory float64
- Vcpu float64
- Virtual
Machines []GetVirtual Machines Virtual Machine - For each filtered virtual machine, this section collect a list of attributes. See virtual-machines-attributes
- Name
Regex string - Order string
- Sort
On string - map[string]string
- cpu Double
- id String
- memory Double
- vcpu Double
- virtual
Machines List<GetVirtual Machines Virtual Machine> - For each filtered virtual machine, this section collect a list of attributes. See virtual-machines-attributes
- name
Regex String - order String
- sort
On String - Map<String,String>
- cpu number
- id string
- memory number
- vcpu number
- virtual
Machines GetVirtual Machines Virtual Machine[] - For each filtered virtual machine, this section collect a list of attributes. See virtual-machines-attributes
- name
Regex string - order string
- sort
On string - {[key: string]: string}
- cpu float
- id str
- memory float
- vcpu float
- virtual_
machines Sequence[GetVirtual Machines Virtual Machine] - For each filtered virtual machine, this section collect a list of attributes. See virtual-machines-attributes
- name_
regex str - order str
- sort_
on str - Mapping[str, str]
- cpu Number
- id String
- memory Number
- vcpu Number
- virtual
Machines List<Property Map> - For each filtered virtual machine, this section collect a list of attributes. See virtual-machines-attributes
- name
Regex String - order String
- sort
On String - Map<String>
Supporting Types
GetVirtualMachinesVirtualMachine
- Cpu double
- Amount of CPU shares assigned to the VM.
- Disks
List<Get
Virtual Machines Virtual Machine Disk> - Id double
- Memory double
- Amount of RAM assigned to the VM in MB.
- Name string
- Nic
Aliases List<GetVirtual Machines Virtual Machine Nic Alias> - Nics
List<Get
Virtual Machines Virtual Machine Nic> - Dictionary<string, string>
- virtual machine tags (Key = Value).
- Vcpu double
- Number of CPU cores presented to the VM.
- Vmgroups
List<Get
Virtual Machines Virtual Machine Vmgroup>
- Cpu float64
- Amount of CPU shares assigned to the VM.
- Disks
[]Get
Virtual Machines Virtual Machine Disk - Id float64
- Memory float64
- Amount of RAM assigned to the VM in MB.
- Name string
- Nic
Aliases []GetVirtual Machines Virtual Machine Nic Alias - Nics
[]Get
Virtual Machines Virtual Machine Nic - map[string]string
- virtual machine tags (Key = Value).
- Vcpu float64
- Number of CPU cores presented to the VM.
- Vmgroups
[]Get
Virtual Machines Virtual Machine Vmgroup
- cpu Double
- Amount of CPU shares assigned to the VM.
- disks
List<Get
Virtual Machines Virtual Machine Disk> - id Double
- memory Double
- Amount of RAM assigned to the VM in MB.
- name String
- nic
Aliases List<GetVirtual Machines Virtual Machine Nic Alias> - nics
List<Get
Virtual Machines Virtual Machine Nic> - Map<String,String>
- virtual machine tags (Key = Value).
- vcpu Double
- Number of CPU cores presented to the VM.
- vmgroups
List<Get
Virtual Machines Virtual Machine Vmgroup>
- cpu number
- Amount of CPU shares assigned to the VM.
- disks
Get
Virtual Machines Virtual Machine Disk[] - id number
- memory number
- Amount of RAM assigned to the VM in MB.
- name string
- nic
Aliases GetVirtual Machines Virtual Machine Nic Alias[] - nics
Get
Virtual Machines Virtual Machine Nic[] - {[key: string]: string}
- virtual machine tags (Key = Value).
- vcpu number
- Number of CPU cores presented to the VM.
- vmgroups
Get
Virtual Machines Virtual Machine Vmgroup[]
- cpu float
- Amount of CPU shares assigned to the VM.
- disks
Sequence[Get
Virtual Machines Virtual Machine Disk] - id float
- memory float
- Amount of RAM assigned to the VM in MB.
- name str
- nic_
aliases Sequence[GetVirtual Machines Virtual Machine Nic Alias] - nics
Sequence[Get
Virtual Machines Virtual Machine Nic] - Mapping[str, str]
- virtual machine tags (Key = Value).
- vcpu float
- Number of CPU cores presented to the VM.
- vmgroups
Sequence[Get
Virtual Machines Virtual Machine Vmgroup]
- cpu Number
- Amount of CPU shares assigned to the VM.
- disks List<Property Map>
- id Number
- memory Number
- Amount of RAM assigned to the VM in MB.
- name String
- nic
Aliases List<Property Map> - nics List<Property Map>
- Map<String>
- virtual machine tags (Key = Value).
- vcpu Number
- Number of CPU cores presented to the VM.
- vmgroups List<Property Map>
GetVirtualMachinesVirtualMachineDisk
- Cache string
- Dev
Prefix string - Discard string
- Driver string
- Image
Id double - Io string
- Size double
- Target string
- Volatile
Format string - Volatile
Type string
- Cache string
- Dev
Prefix string - Discard string
- Driver string
- Image
Id float64 - Io string
- Size float64
- Target string
- Volatile
Format string - Volatile
Type string
- cache String
- dev
Prefix String - discard String
- driver String
- image
Id Double - io String
- size Double
- target String
- volatile
Format String - volatile
Type String
- cache string
- dev
Prefix string - discard string
- driver string
- image
Id number - io string
- size number
- target string
- volatile
Format string - volatile
Type string
- cache str
- dev_
prefix str - discard str
- driver str
- image_
id float - io str
- size float
- target str
- volatile_
format str - volatile_
type str
- cache String
- dev
Prefix String - discard String
- driver String
- image
Id Number - io String
- size Number
- target String
- volatile
Format String - volatile
Type String
GetVirtualMachinesVirtualMachineNic
- Dns string
- Gateway string
- Ip string
- Ip6 string
- Ip6Global string
- Ip6Link string
- Ip6Ula string
- Mac string
- Method string
- Model string
- Name string
- Network string
- Network
Id double - Network
Mode boolAuto - Physical
Device string - Sched
Rank string - Sched
Requirements string - Security
Groups List<double> - Virtio
Queues string
- Dns string
- Gateway string
- Ip string
- Ip6 string
- Ip6Global string
- Ip6Link string
- Ip6Ula string
- Mac string
- Method string
- Model string
- Name string
- Network string
- Network
Id float64 - Network
Mode boolAuto - Physical
Device string - Sched
Rank string - Sched
Requirements string - Security
Groups []float64 - Virtio
Queues string
- dns String
- gateway String
- ip String
- ip6 String
- ip6Global String
- ip6Link String
- ip6Ula String
- mac String
- method String
- model String
- name String
- network String
- network
Id Double - network
Mode BooleanAuto - physical
Device String - sched
Rank String - sched
Requirements String - security
Groups List<Double> - virtio
Queues String
- dns string
- gateway string
- ip string
- ip6 string
- ip6Global string
- ip6Link string
- ip6Ula string
- mac string
- method string
- model string
- name string
- network string
- network
Id number - network
Mode booleanAuto - physical
Device string - sched
Rank string - sched
Requirements string - security
Groups number[] - virtio
Queues string
- dns str
- gateway str
- ip str
- ip6 str
- ip6_
global str - ip6_
link str - ip6_
ula str - mac str
- method str
- model str
- name str
- network str
- network_
id float - network_
mode_ boolauto - physical_
device str - sched_
rank str - sched_
requirements str - security_
groups Sequence[float] - virtio_
queues str
- dns String
- gateway String
- ip String
- ip6 String
- ip6Global String
- ip6Link String
- ip6Ula String
- mac String
- method String
- model String
- name String
- network String
- network
Id Number - network
Mode BooleanAuto - physical
Device String - sched
Rank String - sched
Requirements String - security
Groups List<Number> - virtio
Queues String
GetVirtualMachinesVirtualMachineNicAlias
- dns str
- gateway str
- ip str
- ip6 str
- ip6_
global str - ip6_
link str - ip6_
ula str - mac str
- name str
- network str
- network_
id float - parent str
- security_
groups Sequence[float]
GetVirtualMachinesVirtualMachineVmgroup
- role str
- vmgroup_
id float
Package Details
- Repository
- opennebula opennebula/terraform-provider-opennebula
- License
- Notes
- This Pulumi package is based on the
opennebula
Terraform Provider.
opennebula 1.5.0 published on Friday, Jun 27, 2025 by opennebula