Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Limit for netbox_virtual_machines is not working #660

Open
mdomore opened this issue Nov 26, 2024 · 0 comments
Open

Limit for netbox_virtual_machines is not working #660

mdomore opened this issue Nov 26, 2024 · 0 comments

Comments

@mdomore
Copy link

mdomore commented Nov 26, 2024

Issue Reporting Guide

Hi there,

Thank you for opening an issue. Please note that we try to keep the Terraform
issue tracker reserved for bug reports and feature requests. For general usage
questions, please see: https://www.terraform.io/community.html.

Terraform Version

terraform -v
Terraform v1.9.8
on darwin_arm64

  • provider registry.terraform.io/e-breuninger/netbox v3.9.2
  • provider registry.terraform.io/hashicorp/boundary v1.2.0

netbox version : 4.0.11

Affected Resource(s)

Please list the resources as a list, for example:

  • netbox_virtual_machines

Terraform Configuration Files

# netbox.tf
provider "netbox" {
  server_url = var.netbox_server_url
  api_token  = var.netbox_api_token
}

# Try without the status filter first
data "netbox_virtual_machines" "all_vms" {
  limit = 2500
}

# Alternative with explicit status values
data "netbox_virtual_machines" "active_vms" {
  limit = 2500
  filter {
    name  = "status"
    value = "active"
  }
}

output "simple_counts" {
  value = {
    all_vms_count = length(data.netbox_virtual_machines.all_vms.vms)
    active_vms_count = length(data.netbox_virtual_machines.active_vms.vms)
  }
}

Debug Output

  • status_counts = {
    + active = 776
    + decommissioning = 222
    + offline = 2
    }
    + total_count = 1000

After creating a script to list clusters, and get vms cluster by cluster the result is

"by_status" = {
"active" = 1041
"decommissioning" = 280
"offline" = 7

Expected Behavior

What should have happened?
With a limit at 2500 I should have all my vms listed (in my case 1041 active vms)

Actual Behavior

At the moment with limit = 0, we have 50 vms listed
With limit = 2500 or anything above 1000 we have 1000 vms listed.

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform apply
  2. terraform plan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant