Documentation of reuse_ips and behaviour mismatch

未关闭 适合新手
#167 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
72/100
Issue 类型
文档
描述清晰度
基本清楚
活跃度
活跃
技术栈
go

调研方向

阅读 docs-partials/builder/openstack/RunConfig-not-required.mdx 中对 reuse_ips 的描述,并将其与 builder/openstack/step_allocate_ip.go 中的行为进行比较,尤其是第 74 行附近链接的代码。明确该选项是只重用可用的浮动 IP,还是在没有可用 IP 时创建一个,然后验证文档是否与观察到的行为一致。

由索引模型根据 Issue 内容生成。

描述

bug

Overview

Documentation implies that reuse_ips will trial using any existing floating IPs then create a new one if it cannot find any. I find and code implies to me from a quick look that it will only try reuse_ips and hence if there is not a IP to reuse then will fail.

https://github.com/hashicorp/packer-plugin-openstack/blob/76283e5cef45a5cab6adcf968936c7f24b90e0d4/docs-partials/builder/openstack/RunConfig-not-required.mdx?plain=1#L35-L40

Reproduction Steps

GitLab-ci runner

build-image:
  stage: build
  image: hashicorp/packer
  before_script: 
    - mkdir -p ./openstack
    - mkdir -p /etc/openstack
    - echo "$CLOUDS_YAML" > ./openstack/clouds.yaml
    - cp openstack/clouds.yaml /etc/openstack
  script: 
    - packer init ubuntu.pkr.hcl
    - packer build -var ubuntu_version=noble ubuntu.pkr.hcl`
Plugin and Packer version

From packer version

Simplified Packer Buildfile
packer {
  required_plugins {
      openstack = {
        version = "~> 1"
        source  = "github.com/hashicorp/openstack"
    }
  }
}

source "openstack" "ubuntu" {
  flavor          = "general.v2.small"
  image_name       = "packer-test-ubuntu-${var.ubuntu_version}"
  external_source_image_url = "https://cloud-images.ubuntu.com/${var.ubuntu_version}/current/${var.ubuntu_version}-server-cloudimg-amd64.img"
  ssh_username    = "ubuntu"
  cloud = "openstack"
  networks = ["<removed>"]
  floating_ip_network = "external"
  reuse_ips = true
  insecure            = "true"
  image_disk_format   = "raw"
  use_blockstorage_volume = true
  volume_size = 10
  network_discovery_cidrs = ["<removed>"]

  username     = "ubuntu"
}

Operating system and Environment details

hashicorp/packer docker image, AMD64

Log Fragments related

Packer init versions

$ packer init ubuntu.pkr.hcl
Installed plugin github.com/hashicorp/openstack v1.1.4 in "/root/.config/packer/plugins/github.com/hashicorp/openstack/packer-plugin-openstack_v1.1.4_x5.0_linux_amd64"

Build failure output

==> openstack.ubuntu: Launching server...
==> openstack.ubuntu: Server ID: 3d10800f-b8a6-49b8-b103-7014cb708c55
==> openstack.ubuntu: Waiting for server to become ready...
==> openstack.ubuntu: Searching for unassociated floating IP
==> openstack.ubuntu: Error searching for floating IP: no free floating IPs found
==> openstack.ubuntu: Terminating the source server: 3d10800f-b8a6-49b8-b103-7014cb708c55 ...
==> openstack.ubuntu: Waiting for volume 2be9f422-8822-460d-b56a-d27327df072d to become available...
==> openstack.ubuntu: Deleting volume: 2be9f422-8822-460d-b56a-d27327df072d ...
==> openstack.ubuntu: Deleting temporary external source image: packer_6aeb58c1-a60a-345c-f49c-0f087813cf4b ...
==> openstack.ubuntu: Deleting temporary keypair: packer_6aeb58c1-74e9-b8e2-4f69-9bad19abed95 ...
Build 'openstack.ubuntu' errored after 1 minute 45 seconds: Error searching for floating IP: no free floating IPs found
==> Wait completed after 1 minute 45 seconds
==> Some builds didn't complete successfully and had errors:
--> openstack.ubuntu: Error searching for floating IP: no free floating IPs found
==> Builds finished but no artifacts were created.
主要语言
Go
星标
29
派生
27
PR 合并指标
30 天内没有已合并 PR

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

hashicorp/packer-plugin-openstack 的其他 Issue

查看 hashicorp/packer-plugin-openstack 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。