Skip to content

Cloud.ru ​

Status: available · package wg-flow-plugin-cloudru 0.1.0 · provider cloudru · category cloud.

The plugin reads one Cloud.ru Evolution project. Inventory receives virtual machines, disks, subnets, client VPCs, public IPs, security groups, and network load balancers. The secret stays in the agent YAML.

The agent exchanges an access key (Key ID and Key Secret) for an IAM token and sends Authorization: Bearer. The token lasts one hour; the agent requests a new one. A service-account access key or a personal access key both work.

One source is one project. Copy the project id from the console. The key needs permission to read that project.

The plugin only reads the API. Cloud.ru Advanced is not covered.

Bare Metal, images, backups, placement groups, SNAT gateways, Managed Kubernetes, managed databases, Object Storage, and DNS are not read in 0.1.0. Console URLs are not copied into inventory. Technical subnets, service VPCs, and already deleted load balancers are skipped. A 403 or 404 from the VPC or load balancer API leaves that list empty and does not fail the source. Any other list error fails the whole source, so a partial snapshot is not sent.

Install ​

The agent must be connected to the API.

bash
docker compose exec agent wg-flow-agent plugin install cloudru
# or
wg-flow-agent plugin install cloudru

Then the local UI → Connections → cloudru, or YAML.

Create the key in the Cloud.ru console: a service account access key, or a personal access key in the profile. The Key Secret is shown once. The exchange is described in the Cloud.ru docs.

What lands in inventory ​

Evolution objectresource_typeNotes
Virtual machineinstanceprovider_resource_id = instance:{id}. running → active, stopped → stopped, error* → error, transitional states → pending. Region is the zone (ru.AZ-1). A direct public IP or a floating IP → metadata.primary_ipv4, private addresses → metadata.private_ips. vCPU, memory, and guaranteed share → cpu_cores, mem_gb, core_fraction (1:1 → 100, 1:3 → 30, 1:10 → 10). When disks are collected in the same run, the boot disk size is written to disk_gb
Diskstoragedisk:{id}. available, in_use, and reserved → active. Size is already in gigabytes: metadata.disk_gb and metadata.size_gb
Subnetnetworksubnet:{id}, metadata.product = subnet. CIDR in metadata.ip_ranges. Types technical and zone_technical are skipped
VPCnetworknetwork:{id}, metadata.product = network. Service VPCs are skipped
Public IPnetworkaddress:{id}. metadata.product = public_ip. Address in metadata.primary_ipv4
Security groupfirewallfirewall:{id}. Metadata keeps rule_count only, not the rules
Network load balancerload_balancernlb:{id}. NLB_STATUS_RUNNING → active, NLB_STATUS_SUSPENDED → stopped. A deleted balancer is skipped

There is no separate ip type, so a public address is a network.

Each collect section can be turned off. A disabled section is not requested and is absent from the next successful sync, so inventory marks those rows inactive. disk_gb on a machine appears only when disk collection is on.

Several projects mean several sources. provider_account is your label.

YAML ​

yaml
plugins:
  cloudru:
    enabled: true
    sources:
      - id: prod
        provider_account: "cloudru-prod"
        sync_interval_seconds: 300
        project_id: "496e40f7-cc4b-4fa4-b42a-8cd2c9360716"
        key_id: "…"
        secret: "…"
        collect_instances: true
        collect_disks: true
        collect_networks: true
        collect_addresses: true
        collect_firewalls: true
        collect_load_balancers: true

Source fields ​

FieldRequiredDescription
idyesLog key (cloudru/prod)
provider_accountyesProject label in inventory
project_idyesProject UUID
key_idyesAccess key Key ID
secretyesKey Secret
collect_*noDefault true
sync_interval_secondsnoMinimum 300

Check ​

bash
wg-flow-agent status
wg-flow-agent dry-run

JSON shows provider: cloudru. Health obtains an IAM token and lists virtual machines with limit=1. The key and token are not written to inventory.

Common errors ​

SymptomWhat to check
401Key ID and Key Secret belong to the same access key. An API key (Authorization: Api-Key) is not accepted
403 on the projectThe service account can read this project_id
Empty VM listcollect_instances is on and the machines are in this Evolution project, not Advanced
No disk_gb on a machinecollect_disks is off, so disk size was not requested
No VPCs or load balancersNo access to that API — the source still succeeds
Disks disappear after synccollect_disks was turned off; inventory retires rows that were not sent