Table: azure_compute_virtual_machine_scale_set_vm - Query Azure Compute Virtual Machine Scale Set VMs using SQL
Azure Compute Virtual Machine Scale Sets are a group of identical, load-balanced VMs. They are designed to support true auto-scale, no pre-provisioning of VMs is required, and they let you centrally manage, configure, and update a large number of VMs. With auto-scale, VMs get automatically created and added to a load balancer and get removed when not in use.
Table Usage Guide
The azure_compute_virtual_machine_scale_set_vm
table provides insights into the individual virtual machines within an Azure Virtual Machine Scale Set. As a system administrator, you can explore VM-specific details through this table, including the current state, configuration, and associated metadata. This table is useful for monitoring the status and performance of each VM in a scale set, enabling efficient resource management and troubleshooting.
Examples
Basic info
Analyze the settings to understand the distribution and organization of your virtual machine scale sets in Azure. This can be helpful to manage resources and monitor regional deployment of your virtual machines effectively.
select name, scale_set_name, instance_id, id, vm_id, region, resource_groupfrom azure_compute_virtual_machine_scale_set_vm;
select name, scale_set_name, instance_id, id, vm_id, region, resource_groupfrom azure_compute_virtual_machine_scale_set_vm;
List Standard tier scale set virtual machine
Determine the areas in which standard tier virtual machine scale sets are being used within your Azure environment. This allows for efficient resource allocation and cost management.
select name, scale_set_name, id, sku_name, sku_tierfrom azure_compute_virtual_machine_scale_set_vmwhere sku_tier = 'Standard';
select name, scale_set_name, id, sku_name, sku_tierfrom azure_compute_virtual_machine_scale_set_vmwhere sku_tier = 'Standard';
List all virtual machines under a specific scale set
Explore which virtual machines are part of a particular scale set in Azure. This is useful for managing resources and understanding the distribution of your virtual machines within specific scale sets.
select name, scale_set_name, id, sku_name, sku_tierfrom azure_compute_virtual_machine_scale_set_vmwhere scale_set_name = 'my_vm_scale';
select name, scale_set_name, id, sku_name, sku_tierfrom azure_compute_virtual_machine_scale_set_vmwhere scale_set_name = 'my_vm_scale';
View Network Security Group Rules for a virtual machine
Determine the security rules applied to a specific virtual machine within a network. This is useful for assessing the security measures in place and identifying any potential vulnerabilities or areas for improvement.
select vm.name, nsg.name, jsonb_pretty(security_rules)from azure_compute_virtual_machine_scale_set_vm as vm, jsonb_array_elements(vm.virtual_machine_network_profile) as vm_nic, azure_network_security_group as nsg, jsonb_array_elements(nsg.network_interfaces) as nsg_intwhere lower(vm_nic ->> 'id') = lower(nsg_int ->> 'id') and vm.name = 'warehouse-01';
select vm.name, nsg.name, security_rulesfrom azure_compute_virtual_machine_scale_set_vm as vm, json_each(vm.virtual_machine_network_profile) as vm_nic, azure_network_security_group as nsg, json_each(nsg.network_interfaces) as nsg_intwhere lower(json_extract(vm_nic.value, '$.id')) = lower(json_extract(nsg_int.value, '$.id')) and vm.name = 'warehouse-01';
View power state of virtual machines
Determine the power state of virtual machines in all scale sets.
select vm.name, vm.power_statefrom azure_compute_virtual_machine_scale_set_vm as vm;
select vm.name, vm.power_statefrom azure_compute_virtual_machine_scale_set_vm as vm;
Query examples
- compute_disks_for_compute_virtual_machine_scale_set_vm
- compute_virtual_machine_scale_set_scale_set_name
- compute_virtual_machine_scale_set_sku_name
- compute_virtual_machine_scale_set_vm_data_disks
- compute_virtual_machine_scale_set_vm_image_reference
- compute_virtual_machine_scale_set_vm_network_interface
- compute_virtual_machine_scale_set_vm_os_disks
- compute_virtual_machine_scale_set_vm_tags
- compute_virtual_machine_scale_set_vms_for_network_load_balancer
- compute_virtual_machine_scale_sets_for_compute_virtual_machine_scale_set_vm
- network_interfaces_for_compute_virtual_machine_scale_set_vm
- network_security_groups_for_compute_virtual_machine_scale_set_vm
- network_subnets_for_compute_virtual_machine_scale_set_vm
- network_virtual_networks_for_compute_virtual_machine_scale_set_vm
Schema for azure_compute_virtual_machine_scale_set_vm
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
additional_capabilities | jsonb | Specifies additional capabilities enabled or disabled on the virtual machine in the scale set. For instance: whether the virtual machine has the capability to support attaching managed data disks with UltraSSD_LRS storage account type. | |
akas | jsonb | Array of globally unique identifier strings (also known as) for the resource. | |
availability_set | jsonb | Specifies information about the availability set that the virtual machine should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes to maximize availability. | |
cloud_environment | text | The Azure Cloud Environment. | |
id | text | The unique id identifying the resource in subscription. | |
instance_id | text | = | The virtual machine instance ID. |
latest_model_applied | boolean | Specifies whether the latest model has been applied to the virtual machine. | |
license_type | text | Specifies that the image or disk that is being used was licensed on-premises. | |
location | text | The location of the resource. | |
model_definition_applied | text | Specifies whether the model applied to the virtual machine is the model of the virtual machine scale set or the customized model for the virtual machine. | |
name | text | Name of the scale set VM. | |
plan | jsonb | Specifies information about the marketplace image used to create the virtual machine. | |
power_state | text | Specifies the power state of the VM. | |
protection_policy | jsonb | Specifies the protection policy of the virtual machine. | |
provisioning_state | text | The provisioning state. | |
region | text | The Azure region/location in which the resource is located. | |
resource_group | text | = | The resource group which holds this resource. |
resources | jsonb | The virtual machine child extension resources. | |
scale_set_name | text | = | Name of the scale set. |
sku_capacity | bigint | Specifies the capacity of virtual machines in a scale set virtual machine. | |
sku_name | text | The sku name. | |
sku_tier | text | Specifies the tier of virtual machines in a scale set virtual machine. | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
subscription_id | text | =, !=, ~~, ~~*, !~~, !~~* | The Azure Subscription ID in which the resource is located. |
tags | jsonb | A map of tags for the resource. | |
tags_src | jsonb | Resource tags. | |
title | text | Title of the resource. | |
type | text | The type of the resource in Azure. | |
upgrade_policy | jsonb | The upgrade policy for the scale set. | |
virtual_machine_diagnostics_profile | jsonb | Specifies the boot diagnostic settings state. | |
virtual_machine_hardware_profile | jsonb | Specifies the hardware settings for the virtual machine. | |
virtual_machine_network_profile | jsonb | Specifies properties of the network interfaces of the virtual machines. | |
virtual_machine_network_profile_configuration | jsonb | Specifies the network profile configuration of the virtual machine. | |
virtual_machine_os_profile | jsonb | Specifies the operating system settings for the virtual machines. | |
virtual_machine_security_profile | jsonb | Specifies the Security related profile settings for the virtual machine. | |
virtual_machine_storage_profile | jsonb | SSpecifies the storage settings for the virtual machine disks. | |
vm_id | text | Azure virtual machine unique ID. | |
zones | jsonb | The Logical zone list for scale set. |
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)" -- azure
You can pass the configuration to the command with the --config
argument:
steampipe_export_azure --config '<your_config>' azure_compute_virtual_machine_scale_set_vm