Skip to content

snapshot_name parameter ignored #272

@apoiget

Description

@apoiget

Overview of the Issue

snapshot_name parameter in the source section of Packer is not ignored.

Reproduction Steps

Build an image specifying a string in the snapshot_name parameter. The snapshot linked to the image does not have the name specified.

Plugin and Packer version

$ packer version
Packer v1.14.2

$ packer plugin installed
/home/debian/.config/packer/plugins/github.com/scaleway/scaleway/packer-plugin-scaleway_v1.3.3_x5.0_linux_amd64

Simplified Packer Buildfile

packer {
  required_plugins {
    scaleway = {
      version = ">= 1.3.0"
      source  = "github.com/scaleway/scaleway"
    }
  }
}

source "scaleway" "test" {
  access_key       = var.scw_access_key
  secret_key       = var.scw_secret_key
  project_id       = var.scw_project_id
  zone             = var.scw_region
  remove_volume    = true
  image_name       = "custom-image"
  snapshot_name    = "foo"
  tags = ["custom", "packer"]
  image = "rockylinux_9" # Id or label
  commercial_type = "STARDUST1-S"
  ssh_username = "root"
  ssh_private_key_file = "~/.ssh/id_rsa"
}

build {
  sources = ["source.scaleway.test"]
}

Operating system and Environment details

$ cat /etc/os-release 
PRETTY_NAME="Debian GNU/Linux 13 (trixie)"
NAME="Debian GNU/Linux"
VERSION_ID="13"
VERSION="13 (trixie)"
VERSION_CODENAME=trixie
DEBIAN_VERSION_FULL=13.1
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

$ uname -r
6.12.48+deb13-cloud-amd64

Log Fragments and crash.log files

2025/10/29 09:35:08 Starting build run: scaleway.test
2025/10/29 09:35:08 Running builder: scaleway
==> scaleway.test: Pre-validating image name: custom-image
==> scaleway.test: Pre-validating snapshot name: foo
==> scaleway.test: Using existing SSH private key
==> scaleway.test: Creating server...
==> scaleway.test: Waiting for server to become active...
==> scaleway.test: Using SSH communicator to connect: 51.15.250.37
==> scaleway.test: Waiting for SSH to become available...
==> scaleway.test: Connected to SSH!
==> scaleway.test: Waiting for any user data apply to finish if provided...
==> scaleway.test: Shutting down server...
==> scaleway.test: Backing up server to image: custom-image
==> scaleway.test: Destroying server...
==> scaleway.test: Removing Volumes ...
==> Wait completed after 1 minute 535 milliseconds
==> Builds finished. The artifacts of successful builds are:
Build 'scaleway.test' finished after 1 minute 535 milliseconds.

==> Wait completed after 1 minute 535 milliseconds

==> Builds finished. The artifacts of successful builds are:
--> scaleway.test: An image was created: 'custom-image' (ID: e689d9b2-de2a-42fe-afab-a64bb7263f06) in zone 'fr-par-1' based on snapshots [(: f96796a3-009a-4a07-b2de-1da91b9e2aed)]

$ scw block snapshot list
ID                                    NAME                 SIZE   PROJECT ID                            CREATED AT      UPDATED AT      REFERENCES  STATUS  TAGS             ZONE      CLASS
f96796a3-009a-4a07-b2de-1da91b9e2aed  custom-image_snap_0  10 GB  e89ea458-3e3c-4168-b509-f853351a7cbd  20 seconds ago  20 seconds ago  0           in_use  [custom packer]  fr-par-1  sbs

Complete log with PACKER_LOG=DEBUG: scw_packer_snapshot.log

Moreover in the documentation : Config-not-required.mdx and Scaleway Packer integration doc, default value for image name and snapshot name in the documentation are missing the prefix image- and snapshot- respectively:

snapshot_name (string) - The name of the resulting snapshot that will appear in your account. Default packer-TIMESTAMP

whereas the default value is defined as snapshot-packer-{{timestamp}} code

image_name (string) - The name of the resulting image that will appear in your account. Default packer-TIMESTAMP

whereas the default value is defined as image-packer-{{timestamp}} code

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions