ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud
ibm.getComputeVmInstance
Explore with Pulumi AI
Retrieve information of an existing Virtual Machine (VM) instance as a read-only data source. For more information, about computer VM instance, see enabling auto scale for better capacity and resiliency.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as ibm from "@pulumi/ibm";
const vmInstance = ibm.getComputeVmInstance({
domain: "example.com",
hostname: "jumpbox",
mostRecent: true,
});
import pulumi
import pulumi_ibm as ibm
vm_instance = ibm.get_compute_vm_instance(domain="example.com",
hostname="jumpbox",
most_recent=True)
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/ibm/ibm"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ibm.LookupComputeVmInstance(ctx, &ibm.LookupComputeVmInstanceArgs{
Domain: "example.com",
Hostname: "jumpbox",
MostRecent: pulumi.BoolRef(true),
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ibm = Pulumi.Ibm;
return await Deployment.RunAsync(() =>
{
var vmInstance = Ibm.GetComputeVmInstance.Invoke(new()
{
Domain = "example.com",
Hostname = "jumpbox",
MostRecent = true,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ibm.IbmFunctions;
import com.pulumi.ibm.inputs.GetComputeVmInstanceArgs;
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 vmInstance = IbmFunctions.getComputeVmInstance(GetComputeVmInstanceArgs.builder()
.domain("example.com")
.hostname("jumpbox")
.mostRecent(true)
.build());
}
}
variables:
vmInstance:
fn::invoke:
function: ibm:getComputeVmInstance
arguments:
domain: example.com
hostname: jumpbox
mostRecent: true
Using getComputeVmInstance
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 getComputeVmInstance(args: GetComputeVmInstanceArgs, opts?: InvokeOptions): Promise<GetComputeVmInstanceResult>
function getComputeVmInstanceOutput(args: GetComputeVmInstanceOutputArgs, opts?: InvokeOptions): Output<GetComputeVmInstanceResult>
def get_compute_vm_instance(domain: Optional[str] = None,
hostname: Optional[str] = None,
id: Optional[str] = None,
most_recent: Optional[bool] = None,
opts: Optional[InvokeOptions] = None) -> GetComputeVmInstanceResult
def get_compute_vm_instance_output(domain: Optional[pulumi.Input[str]] = None,
hostname: Optional[pulumi.Input[str]] = None,
id: Optional[pulumi.Input[str]] = None,
most_recent: Optional[pulumi.Input[bool]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetComputeVmInstanceResult]
func LookupComputeVmInstance(ctx *Context, args *LookupComputeVmInstanceArgs, opts ...InvokeOption) (*LookupComputeVmInstanceResult, error)
func LookupComputeVmInstanceOutput(ctx *Context, args *LookupComputeVmInstanceOutputArgs, opts ...InvokeOption) LookupComputeVmInstanceResultOutput
> Note: This function is named LookupComputeVmInstance
in the Go SDK.
public static class GetComputeVmInstance
{
public static Task<GetComputeVmInstanceResult> InvokeAsync(GetComputeVmInstanceArgs args, InvokeOptions? opts = null)
public static Output<GetComputeVmInstanceResult> Invoke(GetComputeVmInstanceInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetComputeVmInstanceResult> getComputeVmInstance(GetComputeVmInstanceArgs args, InvokeOptions options)
public static Output<GetComputeVmInstanceResult> getComputeVmInstance(GetComputeVmInstanceArgs args, InvokeOptions options)
fn::invoke:
function: ibm:index/getComputeVmInstance:getComputeVmInstance
arguments:
# arguments dictionary
The following arguments are supported:
- Domain string
- The domain of the VM instance.
- Hostname string
- The hostname of the VM instance.
- Id string
- (String) The unique identifier of the VM instance.
- Most
Recent bool - For multiple VM instances, you can set this argument to true to import only the most recently created instance.
- Domain string
- The domain of the VM instance.
- Hostname string
- The hostname of the VM instance.
- Id string
- (String) The unique identifier of the VM instance.
- Most
Recent bool - For multiple VM instances, you can set this argument to true to import only the most recently created instance.
- domain String
- The domain of the VM instance.
- hostname String
- The hostname of the VM instance.
- id String
- (String) The unique identifier of the VM instance.
- most
Recent Boolean - For multiple VM instances, you can set this argument to true to import only the most recently created instance.
- domain string
- The domain of the VM instance.
- hostname string
- The hostname of the VM instance.
- id string
- (String) The unique identifier of the VM instance.
- most
Recent boolean - For multiple VM instances, you can set this argument to true to import only the most recently created instance.
- domain str
- The domain of the VM instance.
- hostname str
- The hostname of the VM instance.
- id str
- (String) The unique identifier of the VM instance.
- most_
recent bool - For multiple VM instances, you can set this argument to true to import only the most recently created instance.
- domain String
- The domain of the VM instance.
- hostname String
- The hostname of the VM instance.
- id String
- (String) The unique identifier of the VM instance.
- most
Recent Boolean - For multiple VM instances, you can set this argument to true to import only the most recently created instance.
getComputeVmInstance Result
The following output properties are available:
- Cores double
- (Integer) The number of CPU cores.
- Datacenter string
- (String) The data center in which the VM instance is deployed.
- Domain string
- Hostname string
- Id string
- (String) The unique identifier of the VM instance.
- Ip
Address doubleId - (String) The unique identifier for the public IPv4 address that is assigned to the VM instance.
- Ip
Address doubleId Private - (String) The unique identifier for the private IPv4 address that is assigned to the VM instance.
- Ipv4Address string
- (String) The public IPv4 address of the VM instance.
- Ipv4Address
Private string - (String) The private IPv4 address of the VM instance.
- Ipv6Address string
- (String) The public IPv6 address of the VM instance provided when
ipv6_enabled
is set to true. - Ipv6Address
Id double - (String) The unique identifier for the public IPv6 address assigned to the VM instance provided when
ipv6_enabled
is set to true. - Last
Known stringPower State - (String) The last known power state of a VM instance, if the instance is turned off outside the information management system (IMS) is offline.
- Power
State string - (String) The current power state of a VM instance.
- Private
Interface doubleId - (String) The ID of the primary private interface.
- Private
Subnet doubleId - (String) The unique identifier of the subnet
ipv4_address_private
belongs to. - Public
Interface doubleId - (String) The ID of the primary public interface.
- Public
Ipv6Subnet string - (String) The public IPv6 subnet provided when
ipv6_enabled
is set to true. - Public
Ipv6Subnet stringId - (String) The unique identifier of the subnet
ipv6_address
belongs to. - Public
Subnet doubleId - (String) The unique identifier of the subnet
ipv4_address
belongs to. - Secondary
Ip List<string>Addresses - (String) The public secondary IPv4 addresses of the VM instance.
- Secondary
Ip doubleCount - (Integer) Number of secondary public IPv4 addresses.
- Status string
- (String) The VSI status.
- Most
Recent bool
- Cores float64
- (Integer) The number of CPU cores.
- Datacenter string
- (String) The data center in which the VM instance is deployed.
- Domain string
- Hostname string
- Id string
- (String) The unique identifier of the VM instance.
- Ip
Address float64Id - (String) The unique identifier for the public IPv4 address that is assigned to the VM instance.
- Ip
Address float64Id Private - (String) The unique identifier for the private IPv4 address that is assigned to the VM instance.
- Ipv4Address string
- (String) The public IPv4 address of the VM instance.
- Ipv4Address
Private string - (String) The private IPv4 address of the VM instance.
- Ipv6Address string
- (String) The public IPv6 address of the VM instance provided when
ipv6_enabled
is set to true. - Ipv6Address
Id float64 - (String) The unique identifier for the public IPv6 address assigned to the VM instance provided when
ipv6_enabled
is set to true. - Last
Known stringPower State - (String) The last known power state of a VM instance, if the instance is turned off outside the information management system (IMS) is offline.
- Power
State string - (String) The current power state of a VM instance.
- Private
Interface float64Id - (String) The ID of the primary private interface.
- Private
Subnet float64Id - (String) The unique identifier of the subnet
ipv4_address_private
belongs to. - Public
Interface float64Id - (String) The ID of the primary public interface.
- Public
Ipv6Subnet string - (String) The public IPv6 subnet provided when
ipv6_enabled
is set to true. - Public
Ipv6Subnet stringId - (String) The unique identifier of the subnet
ipv6_address
belongs to. - Public
Subnet float64Id - (String) The unique identifier of the subnet
ipv4_address
belongs to. - Secondary
Ip []stringAddresses - (String) The public secondary IPv4 addresses of the VM instance.
- Secondary
Ip float64Count - (Integer) Number of secondary public IPv4 addresses.
- Status string
- (String) The VSI status.
- Most
Recent bool
- cores Double
- (Integer) The number of CPU cores.
- datacenter String
- (String) The data center in which the VM instance is deployed.
- domain String
- hostname String
- id String
- (String) The unique identifier of the VM instance.
- ip
Address DoubleId - (String) The unique identifier for the public IPv4 address that is assigned to the VM instance.
- ip
Address DoubleId Private - (String) The unique identifier for the private IPv4 address that is assigned to the VM instance.
- ipv4Address String
- (String) The public IPv4 address of the VM instance.
- ipv4Address
Private String - (String) The private IPv4 address of the VM instance.
- ipv6Address String
- (String) The public IPv6 address of the VM instance provided when
ipv6_enabled
is set to true. - ipv6Address
Id Double - (String) The unique identifier for the public IPv6 address assigned to the VM instance provided when
ipv6_enabled
is set to true. - last
Known StringPower State - (String) The last known power state of a VM instance, if the instance is turned off outside the information management system (IMS) is offline.
- power
State String - (String) The current power state of a VM instance.
- private
Interface DoubleId - (String) The ID of the primary private interface.
- private
Subnet DoubleId - (String) The unique identifier of the subnet
ipv4_address_private
belongs to. - public
Interface DoubleId - (String) The ID of the primary public interface.
- public
Ipv6Subnet String - (String) The public IPv6 subnet provided when
ipv6_enabled
is set to true. - public
Ipv6Subnet StringId - (String) The unique identifier of the subnet
ipv6_address
belongs to. - public
Subnet DoubleId - (String) The unique identifier of the subnet
ipv4_address
belongs to. - secondary
Ip List<String>Addresses - (String) The public secondary IPv4 addresses of the VM instance.
- secondary
Ip DoubleCount - (Integer) Number of secondary public IPv4 addresses.
- status String
- (String) The VSI status.
- most
Recent Boolean
- cores number
- (Integer) The number of CPU cores.
- datacenter string
- (String) The data center in which the VM instance is deployed.
- domain string
- hostname string
- id string
- (String) The unique identifier of the VM instance.
- ip
Address numberId - (String) The unique identifier for the public IPv4 address that is assigned to the VM instance.
- ip
Address numberId Private - (String) The unique identifier for the private IPv4 address that is assigned to the VM instance.
- ipv4Address string
- (String) The public IPv4 address of the VM instance.
- ipv4Address
Private string - (String) The private IPv4 address of the VM instance.
- ipv6Address string
- (String) The public IPv6 address of the VM instance provided when
ipv6_enabled
is set to true. - ipv6Address
Id number - (String) The unique identifier for the public IPv6 address assigned to the VM instance provided when
ipv6_enabled
is set to true. - last
Known stringPower State - (String) The last known power state of a VM instance, if the instance is turned off outside the information management system (IMS) is offline.
- power
State string - (String) The current power state of a VM instance.
- private
Interface numberId - (String) The ID of the primary private interface.
- private
Subnet numberId - (String) The unique identifier of the subnet
ipv4_address_private
belongs to. - public
Interface numberId - (String) The ID of the primary public interface.
- public
Ipv6Subnet string - (String) The public IPv6 subnet provided when
ipv6_enabled
is set to true. - public
Ipv6Subnet stringId - (String) The unique identifier of the subnet
ipv6_address
belongs to. - public
Subnet numberId - (String) The unique identifier of the subnet
ipv4_address
belongs to. - secondary
Ip string[]Addresses - (String) The public secondary IPv4 addresses of the VM instance.
- secondary
Ip numberCount - (Integer) Number of secondary public IPv4 addresses.
- status string
- (String) The VSI status.
- most
Recent boolean
- cores float
- (Integer) The number of CPU cores.
- datacenter str
- (String) The data center in which the VM instance is deployed.
- domain str
- hostname str
- id str
- (String) The unique identifier of the VM instance.
- ip_
address_ floatid - (String) The unique identifier for the public IPv4 address that is assigned to the VM instance.
- ip_
address_ floatid_ private - (String) The unique identifier for the private IPv4 address that is assigned to the VM instance.
- ipv4_
address str - (String) The public IPv4 address of the VM instance.
- ipv4_
address_ strprivate - (String) The private IPv4 address of the VM instance.
- ipv6_
address str - (String) The public IPv6 address of the VM instance provided when
ipv6_enabled
is set to true. - ipv6_
address_ floatid - (String) The unique identifier for the public IPv6 address assigned to the VM instance provided when
ipv6_enabled
is set to true. - last_
known_ strpower_ state - (String) The last known power state of a VM instance, if the instance is turned off outside the information management system (IMS) is offline.
- power_
state str - (String) The current power state of a VM instance.
- private_
interface_ floatid - (String) The ID of the primary private interface.
- private_
subnet_ floatid - (String) The unique identifier of the subnet
ipv4_address_private
belongs to. - public_
interface_ floatid - (String) The ID of the primary public interface.
- public_
ipv6_ strsubnet - (String) The public IPv6 subnet provided when
ipv6_enabled
is set to true. - public_
ipv6_ strsubnet_ id - (String) The unique identifier of the subnet
ipv6_address
belongs to. - public_
subnet_ floatid - (String) The unique identifier of the subnet
ipv4_address
belongs to. - secondary_
ip_ Sequence[str]addresses - (String) The public secondary IPv4 addresses of the VM instance.
- secondary_
ip_ floatcount - (Integer) Number of secondary public IPv4 addresses.
- status str
- (String) The VSI status.
- most_
recent bool
- cores Number
- (Integer) The number of CPU cores.
- datacenter String
- (String) The data center in which the VM instance is deployed.
- domain String
- hostname String
- id String
- (String) The unique identifier of the VM instance.
- ip
Address NumberId - (String) The unique identifier for the public IPv4 address that is assigned to the VM instance.
- ip
Address NumberId Private - (String) The unique identifier for the private IPv4 address that is assigned to the VM instance.
- ipv4Address String
- (String) The public IPv4 address of the VM instance.
- ipv4Address
Private String - (String) The private IPv4 address of the VM instance.
- ipv6Address String
- (String) The public IPv6 address of the VM instance provided when
ipv6_enabled
is set to true. - ipv6Address
Id Number - (String) The unique identifier for the public IPv6 address assigned to the VM instance provided when
ipv6_enabled
is set to true. - last
Known StringPower State - (String) The last known power state of a VM instance, if the instance is turned off outside the information management system (IMS) is offline.
- power
State String - (String) The current power state of a VM instance.
- private
Interface NumberId - (String) The ID of the primary private interface.
- private
Subnet NumberId - (String) The unique identifier of the subnet
ipv4_address_private
belongs to. - public
Interface NumberId - (String) The ID of the primary public interface.
- public
Ipv6Subnet String - (String) The public IPv6 subnet provided when
ipv6_enabled
is set to true. - public
Ipv6Subnet StringId - (String) The unique identifier of the subnet
ipv6_address
belongs to. - public
Subnet NumberId - (String) The unique identifier of the subnet
ipv4_address
belongs to. - secondary
Ip List<String>Addresses - (String) The public secondary IPv4 addresses of the VM instance.
- secondary
Ip NumberCount - (Integer) Number of secondary public IPv4 addresses.
- status String
- (String) The VSI status.
- most
Recent Boolean
Package Details
- Repository
- ibm ibm-cloud/terraform-provider-ibm
- License
- Notes
- This Pulumi package is based on the
ibm
Terraform Provider.