Table: ibm_is_instance - Query IBM Cloud Infrastructure Instances using SQL
IBM Cloud Infrastructure Instances are virtual server instances deployed in IBM Cloud. They are a part of IBM's Infrastructure as a Service (IaaS) offering, providing scalable compute capacity for applications and workloads. These instances can be customized based on the compute power, memory, and storage requirements, and can be managed and accessed over the internet.
Table Usage Guide
The ibm_is_instance
table provides insights into instances within IBM Cloud Infrastructure. As a system administrator or a DevOps engineer, explore instance-specific details through this table, including status, VPC, zone, profile, and resources. Utilize it to uncover information about instances, such as their current state, associated resources, and the zones in which they are deployed.
Examples
Basic info
Discover the segments that are currently active, along with their unique identifiers and creation dates, to gain insights into your IBM cloud instances. This can help in managing and tracking the status of your instances.
select name, id, crn, status, created_atfrom ibm_is_instance;
select name, id, crn, status, created_atfrom ibm_is_instance;
List instances by name
This query is used to identify specific instances by their name, in this case 'steampipe01'. It's useful for quickly locating specific instances, allowing for efficient management and monitoring of their status and other details.
select name, id, crn, status, created_atfrom ibm_is_instancewhere name = 'steampipe01';
select name, id, crn, status, created_atfrom ibm_is_instancewhere name = 'steampipe01';
Instance count in each availability zone
Explore which availability zones are hosting the most instances. This can help in understanding the distribution of resources and identifying any potential zones that may be underutilized or overloaded.
select zone ->> 'name' as zone_name, count(*)from ibm_is_instancegroup by zone_name;
select json_extract(zone, '$.name') as zone_name, count(*)from ibm_is_instancegroup by zone_name;
Get instance disks attached with instance
Analyze the settings to understand the association between instances and their attached disks, including the size of each disk. This is useful in managing storage resources, ensuring adequate disk space for each instance.
select name as instance_name, d ->> 'name' as instance_disk_name, d ->> 'size' as disk_sizefrom ibm_is_instance, jsonb_array_elements(disks) as d;
select name as instance_name, json_extract(d.value, '$.name') as instance_disk_name, json_extract(d.value, '$.size') as disk_sizefrom ibm_is_instance, json_each(disks) as d;
Get floating ips associated to the instances
Explore which instances have floating IP addresses associated with them. This is useful for understanding the network configuration and resource allocation within your IBM cloud infrastructure.
select name, fip -> 'target' ->> 'id' as network_interface_id, fip ->> 'address' as floating_ip, fip ->> 'created_at' as create_timefrom ibm_is_instance, jsonb_array_elements(floating_ips) as fip;
select name, json_extract(fip.value, '$.target.id') as network_interface_id, json_extract(fip.value, '$.address') as floating_ip, json_extract(fip.value, '$.created_at') as create_timefrom ibm_is_instance, json_each(floating_ips) as fip;
Query examples
- ibm_compute_instance_1_year_count
- ibm_compute_instance_24_hours_count
- ibm_compute_instance_30_90_days_count
- ibm_compute_instance_30_days_count
- ibm_compute_instance_90_365_days_count
- ibm_compute_instance_architecture
- ibm_compute_instance_bandwidth
- ibm_compute_instance_boot_volume
- ibm_compute_instance_by_account
- ibm_compute_instance_by_architecture
- ibm_compute_instance_by_creation_month
- ibm_compute_instance_by_floating_ip
- ibm_compute_instance_by_region
- ibm_compute_instance_by_zone
- ibm_compute_instance_count
- ibm_compute_instance_data_volume
- ibm_compute_instance_image
- ibm_compute_instance_input
- ibm_compute_instance_memory
- ibm_compute_instance_network_interfaces
- ibm_compute_instance_overview
- ibm_compute_instance_tags
- ibm_compute_instance_total_vcpu
- ibm_compute_instance_total_vcpu_count
- ibm_compute_instance_vpc
- ibm_compute_instance_zone
- ibm_compute_public_instance
- ibm_compute_public_instance_count
Schema for ibm_is_instance
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form, e.g. connection_name. | |
account_id | text | The account ID of this instance. | |
akas | jsonb | Array of globally unique identifier strings (also known as) for the resource. | |
bandwidth | bigint | The total bandwidth (in megabits per second) shared across the virtual server instance's network interfaces. | |
boot_volume_attachment | jsonb | Specifies the boot volume attachment. | |
created_at | timestamp with time zone | The date and time that the virtual server instance was created. | |
crn | text | The CRN for this virtual server instance. | |
disks | jsonb | A collection of the instance's disks. | |
floating_ips | jsonb | Floating IPs allow inbound and outbound traffic from the Internet to an instance | |
gpu | jsonb | The virtual server instance GPU configuration. | |
href | text | The URL for this virtual server instance. | |
id | text | = | The unique identifier for this virtual server instance. |
image | jsonb | The image the virtual server instance was provisioned from. | |
memory | bigint | The amount of memory, truncated to whole gibibytes. | |
name | text | = | The user-defined name for this virtual server instance (and default system hostname). |
network_interfaces | jsonb | A collection of the virtual server instance's network interfaces, including the primary network interface. | |
primary_network_interface | jsonb | Specifies the primary network interface. | |
profile | jsonb | The profile for this virtual server instance. | |
region | text | The region of this instance. | |
resource_group | jsonb | The resource group for this instance. | |
status | text | The status of the virtual server instance. | |
tags | jsonb | A map of tags for the resource. | |
title | text | Title of the resource. | |
vcpu | jsonb | The virtual server instance VCPU configuration. | |
volume_attachments | jsonb | A collection of the virtual server instance's volume attachments, including the boot volume attachment. | |
vpc | jsonb | The VPC this virtual server instance resides in. | |
zone | jsonb | The zone this virtual server instance resides in. |
Export
This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.
You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh
script:
/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- ibm
You can pass the configuration to the command with the --config
argument:
steampipe_export_ibm --config '<your_config>' ibm_is_instance