steampipe plugin install ibm

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_at
from
ibm_is_instance;
select
name,
id,
crn,
status,
created_at
from
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_at
from
ibm_is_instance
where
name = 'steampipe01';
select
name,
id,
crn,
status,
created_at
from
ibm_is_instance
where
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_instance
group by
zone_name;
select
json_extract(zone, '$.name') as zone_name,
count(*)
from
ibm_is_instance
group 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_size
from
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_size
from
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_time
from
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_time
from
ibm_is_instance,
json_each(floating_ips) as fip;

Schema for ibm_is_instance

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form, e.g. connection_name.
account_idtextThe account ID of this instance.
akasjsonbArray of globally unique identifier strings (also known as) for the resource.
bandwidthbigintThe total bandwidth (in megabits per second) shared across the virtual server instance's network interfaces.
boot_volume_attachmentjsonbSpecifies the boot volume attachment.
created_attimestamp with time zoneThe date and time that the virtual server instance was created.
crntextThe CRN for this virtual server instance.
disksjsonbA collection of the instance's disks.
floating_ipsjsonbFloating IPs allow inbound and outbound traffic from the Internet to an instance
gpujsonbThe virtual server instance GPU configuration.
hreftextThe URL for this virtual server instance.
idtext=The unique identifier for this virtual server instance.
imagejsonbThe image the virtual server instance was provisioned from.
memorybigintThe amount of memory, truncated to whole gibibytes.
nametext=The user-defined name for this virtual server instance (and default system hostname).
network_interfacesjsonbA collection of the virtual server instance's network interfaces, including the primary network interface.
primary_network_interfacejsonbSpecifies the primary network interface.
profilejsonbThe profile for this virtual server instance.
regiontextThe region of this instance.
resource_groupjsonbThe resource group for this instance.
statustextThe status of the virtual server instance.
tagsjsonbA map of tags for the resource.
titletextTitle of the resource.
vcpujsonbThe virtual server instance VCPU configuration.
volume_attachmentsjsonbA collection of the virtual server instance's volume attachments, including the boot volume attachment.
vpcjsonbThe VPC this virtual server instance resides in.
zonejsonbThe 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