Giter Club home page Giter Club logo

packer-plugin-outscale's Introduction

Project Graduated

Packer Plugin Outscale

The Outscale multi-component plugin can be used with HashiCorp Packer to create custom images. For the full list of available features for this plugin see docs.

Installation

Using pre-built releases

Using the packer init command

Starting from version 1.7, Packer supports a new packer init command allowing automatic installation of Packer plugins. Read the Packer documentation for more information.

To install this plugin, copy and paste this code into your Packer configuration . Then, run packer init.

packer {
  required_plugins {
    outscale = {
      version = ">= 1.0.0"
      source  = "github.com/outscale/outscale"
    }
  }
}

Manual installation

You can find pre-built binary releases of the plugin here. Once you have downloaded the latest archive corresponding to your target OS, uncompress it to retrieve the plugin binary file corresponding to your platform. To install the plugin, please follow the Packer documentation on installing a plugin.

From Sources

If you prefer to build the plugin from sources, clone the GitHub repository locally and run the command go build from the root directory. Upon successful compilation, a packer-plugin-outscale plugin binary file can be found in the root directory. To install the compiled plugin, please follow the official Packer documentation on installing a plugin.

Configuration

For more information on how to configure the plugin, please read the documentation located in the docs/ directory.

Contributing

  • If you think you've found a bug in the code or you have a question regarding the usage of this software, please reach out to us by opening an issue in this GitHub repository.
  • Contributions to this project are welcome: if you want to add a feature or a fix a bug, please do so by opening a Pull Request in this GitHub repository. In case of feature contribution, we kindly ask you to open an issue to discuss it beforehand.

packer-plugin-outscale's People

Contributors

azr avatar catsby avatar cbednarski avatar chrislundquist avatar danham avatar dependabot[bot] avatar jen20 avatar jeremy-asher avatar jerome-jutteau avatar jescalan avatar jmassara avatar marinsalinas avatar mitchellh avatar mwhooker avatar nywilken avatar outscale-hmi avatar outscale-mdr avatar outscale-mgo avatar outscale-toa avatar pacodw avatar pas256 avatar paulmey avatar prydie avatar psinghal20 avatar rasa avatar rickard-von-essen avatar sethvargo avatar swampdragons avatar sylviamoss avatar timdawson264 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

packer-plugin-outscale's Issues

Source OMI filters

Overview of the Issue

The parameter owners in Source OMI filters stands for Account alias but not account ID like it is said in the documentation.

Reproduction Steps

I tried to get the source image lin my packer template like this :
source_omi_filter { filters = { image-name = "RockyLinux-8-2022.01.18-0" } owners = ["123456789125"] }

It doesn't find the image.

But when I tried this :

source_omi_filter { filters = { image-name = "RockyLinux-8-2022.01.18-0" } owners = ["Outscale"] }

It works.

Plugin and Packer version

From 1.1.1

Simplified Packer Buildfile

Github detailed
format

Operating system and Environment details

Rocky9.1, x86_64

Improve error message on no OMI found

Hello,

I have tried to build an OMI but the source OMI was wrong and I got this error:

==> outscale-bsusurrogate.builder: No OMI was found matching filters: osc.ReadImagesRequest{DryRun:(*bool)(nil), Filters:(*osc.FiltersImage)(0x140003de180)}
Build 'outscale-bsusurrogate.builder' errored after 735 milliseconds 610 microseconds: No OMI was found matching filters: osc.ReadImagesRequest{DryRun:(*bool)(nil), Filters:(*osc.FiltersImage)(0x140003de180)}

Is it possible to improve the error message to display the real Filters ?

Packer version: 1.9.4
Outscale plugin: 1.1.3

packer build - Unable to connect to the source AMI

Overview of the Issue

I follow this documentation to build my own fedora AMI ( https://docs.outscale.com/en/userguide/Migrating-a-Linux-Instance-to-the-OUTSCALE-Cloud.html#_migrate_the_instance_from_aws ).

After creating the AMI, packer refuse to connect to it but I can "manualy" with the same key

2022/09/10 10:45:14 machine readable: coreos-outscale.osc-bsusurrogate.coreos,error []string{"Packer experienced an authentication error when trying to connect via SSH. This can happen if your username/password are wrong. You may want to double-check your credentials as part of your debugging process. original error: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain"}

Reproduction Steps

Plugin and Packer version

Packer v1.7.10

Simplified Packer Buildfile

outscale.pkd.hcl

Operating system and Environment details

Ubuntu on WSL

Log Fragments and crash.log files

https://gist.github.com/clementcohen/45deb8331fe9aa3f164f2756f42077c6
Set the env var PACKER_LOG=1 for maximum log detail.

Outscale provider requires omi_virtualization_type

This issue was originally opened by @Hakujou as hashicorp/packer#8007. It was migrated here as a result of the Packer plugin split. The original body of the issue is below.


Hello,

I currently have an issue with Packer and Outscale BSUSurrogate builder (https://packer.io/docs/builders/osc-bsusurrogate.html).

The documentation states that omi_virtualization_type is optional but it's not. Packer says * omi_virtualization_type is required..

Packer version: Packer v1.4.3
Host platform: MacOS 10.14.5 x64
Packer template: https://gist.github.com/Hakujou/3ea3022be379e8aada69dee1a57cf300
Packer logs:
debug.txt

Thanks

Support of external credential file for Outscale builder

This issue was originally opened by @skelkey as hashicorp/packer#10053. It was migrated here as a result of the Packer plugin split. The original body of the issue is below.


Community Note

Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request.
If you are interested in working on this issue or have submitted a pull request, please leave a comment.

Description

It will be a nice feature to add the support of external file for credentials. Actually the builder support :

  • Static credentials
  • Environment variables

The documentation (https://www.packer.io/docs/builders/outscale#authentication) mention the support of Shared credential file, but I haven't found documentation or support of this feature. It will improve the security in usage of credentials. (cc @Hakujou )

Use Case(s)

  • Reducing the risks to commit credentials in the JSON
  • Reducing the risks to type secret in a terminal by settings environment variable

Potential configuration

Something like :

"credentials_file" = "<path>"
"credentials_profile = "<profile>"

content of the file :

[<profile>]
access_key=...
secret_key=..

Potential References

https://www.packer.io/docs/builders/amazon/ebssurrogate#shared_credentials_file

Add the new ProductCodes parameter as a configuration option

Community Note

Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request.
If you are interested in working on this issue or have submitted a pull request, please leave a comment.

Description

We would like to have a new parameter ProductCodes available in the Outscale plugin configuration.
This parameter must be only available for Image creation (not when updating Images)

Use Case(s)

This parameter will let users set one or multiple ProductCode to the Image they create with Packer
This option will be used by Outscale Marketplace partners that want to create and share their Image to other users.

Potential configuration

A new configuration option named ProductCodes

Potential References

CreateImage OAPI Docs

Fix go-releaser

Quick team note:

Seems we have an issue with go-releaser: we have a 1.0.1-dev version as User-Agent which should not.
Also, check version/version.go

Unknown source type osc-bsusurrogate

When filing a bug, please include the following headings if possible. Any
example text in this template can be deleted.

Overview of the Issue

Error: Unknown source type osc-bsusurrogate

Reproduction Steps

use the sample osc-bsu.pkr.hcl

Plugin and Packer version

Packer v1.8.3

Simplified Packer Buildfile

sample directory in this project: osc-bsu.pkr.hcl

Operating system and Environment details

ubuntu on WSL

Log Fragments and crash.log files

gist

Public Omi has its snapshot also public

Overview of the Issue

I want to create a public omi with packer. But when omi is public its snapshot is also public so every client in the region has this snapshot and only the account which is associated with the accountId can delete it. So when we want to have a public omi its snapshot should be private.

Reproduction Steps

Have this parameters in your config:

      "global_permission": true,
      "omi_account_ids": [
        "0123456789"
      ],

Plugin and Packer version

Packer v1.8.5
Packer Outscale plugins v1.0.5

Operating system and Environment details

Ubuntu 20.04.3 LTS

Outscale: Support for owner account aliases in source_omi_filter

This issue was originally opened by @Hakujou as hashicorp/packer#10915. It was migrated here as a result of the Packer plugin split. The original body of the issue is below.


Overview of the Issue

source_omi_filter in Outscale builders requires "owners" to be set for security reasons ("* For security reasons, your source AMI filter must declare an owner.").
There's no way to set owner pointing to an Outscale Account alias instead of ID.

Per API documentation (https://docs.outscale.com/api#readimages), account aliases should be set as "AccountAliases", not "AccountIds".

Reproduction Steps

Set inside your HCL2 Packer script:

source_omi_filter {
        filters = {
            name = "SourceImageName"
        }
        owners = ["Outscale"]
}

Then execute packer build xxx.pkr.hcl. It will return:

No OMI was found matching filters: osc.ReadImagesRequest{DryRun:false, Filters:osc.FiltersImage{AccountAliases:[]string(nil), AccountIds:[]string{"Outscale"}...

We clearly see that "Outscale" is passed to AccountIds, not AccountAliases.

Packer version

Packer v1.7.0

ping @marinsalinas

Explicit errors on missing parameters

Description

When omitting certain parameters, such as region (either from env or conf), the error is not really explicit (it only produces malformed URL).
Packer could return a more explicit error to indicate the missing parameter(s).

Use Case(s)

N/A

Potential configuration

N/A

Potential References

See outscale/omi-packer#3.

Breaking changes in go-cty

In v1.11.0 of github.com/zclconf/go-cty, encoding/gob support was removed from the package. The Packer plugin SDK relies on gob for supporting HCL2 templates. The removal of the encoding causes Packer to crash when using HCL2 templates.

The team and I are working internally to find the best path forward, as a change to the wire protocol from gob will introduce a breaking change and plugin incompatibilities. We are working to notify plugin developers of the incompatible go-cty package and ask that all external plugins pin the versions of the following two packages to those used by the Packer plugin SDK.

github.com/hashicorp/hcl/v2 v2.13.0
github.com/zclconf/go-cty v1.10.0

Update to packer-sdc command for validating plugin compatibility

👋 Fellow Packer maintainer here, reaching out to inform you about an upcoming breaking change that will affect your goreleaser release pipeline. In Packer 1.8.0 we will remove the packer-plugin-check command in Packer core in favor of the packer-sdc plugin-check command from the Packer Plugin SDK. So calling go install github.com/hashicorp/packer/cmd/packer-plugins-check@latest will result in an error.

To avoid potential issues I recommend either pinning the packer-plugins-check command to the current version of Packer until you can move to the packer-sdc command

go install github.com/hashicorp/packer/cmd/[email protected]

Or you can update your release configuration to use the packer-sdc command, which is the preferred long-term solution.

I'v provided a link to the updates that were made to the Packer Plugin Scaffolding for using the packer-sdc command here

Please let me know if you have any questions.

OMI Product Code attribute support for Outscale provider

This issue was originally opened by @Hakujou as hashicorp/packer#8549. It was migrated here as a result of the Packer plugin split. The original body of the issue is below.


Feature Description

Outscale allows modifications of Product Code attributes in its images (OMI), which does not seem to be supported by Packer.
Would it be possible to add it (such as "omi_product_codes" attribute, as we can have multiple product codes for one image) ?

Use Case(s)

Product Code is used to calculate billing and providing special features for certain images (such as Windows password generation), setting it is mandatory for certain images to avoid billing issues and fraudulent usage of certain images.

Pinging @marinsalinas.

Thanks !

Outscale builder: Implement most_recent in source_omi_filter

This issue was originally opened by @Hakujou as hashicorp/packer#10498. It was migrated here as a result of the Packer plugin split. The original body of the issue is below.


Community Note

Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request.
If you are interested in working on this issue or have submitted a pull request, please leave a comment.

Description

As of today, the filters defined in source_omi_filter do not offer most_recent because upstream API does not offer it.
Until the feature is implemented on Outscale API, could you rely on the dates returned by the API (CreationDate attribute of Image) to return only the most recent one ?

This would allow to have a working "most_recent" until it is implemented on upstream Outscale API.

Use Case(s)

Any relevant use-cases that you see.

Potential configuration

{
  "source_omi_filter": {
    "filters": {
      "image-name": "image-name-*"
    },
    "most_recent": "true"
  }
}

Potential References

https://docs.outscale.com/api#readimages

Ping @marinsalinas

SSH timeout on public IP in VPC/net

Overview of the Issue

Hi,
Packer can't reach a temporary VM created in a VPC on it's public IP. Timeout at step "Waiting for SSH to become available...".
My guess is that it's broken since the SDK update, and could be related to that patch not being applicable anymore: https://github.com/hashicorp/packer/pull/8077/files

Reproduction Steps

I have written a simple test environment with terraform. Change the region variable as you convenience, the eu-west-2 API is currently unstable so I made it on cloudgouv-eu-west-1.

export AWS_ACCESS_KEY_ID=XXXXXXXXXX
export AWS_SECRET_ACCESS_KEY=YYYYYYYYYYYYYYYYYY
wget https://gist.githubusercontent.com/wibru/d95c61515108881db6487f20987b1a74/raw/ced3948c1c1fb2c7a29e042a7dc29dc81e9d48b8/osc-packer-eip-bug.tf
wget https://gist.githubusercontent.com/wibru/d95c61515108881db6487f20987b1a74/raw/ced3948c1c1fb2c7a29e042a7dc29dc81e9d48b8/osc-packer-eip-bug.pkr.hcl
terraform init
terraform apply
packer init osc-packer-eip-bug.pkr.hcl
PACKER_LOG=1 packer build -debug -var-file test.pkvars.json osc-packer-eip-bug.pkr.hcl

Plugin and Packer version

$ packer -version
1.9.1

OK with plugin 1.0.5
KO since plugin 1.0.6 to 1.1.2 included.

Simplified Packer Buildfile

URLs above

Operating system and Environment details

Debian 11 client

Log Fragments and crash.log files

#### without ssh_interface = "public_ip":

   outscale-bsu.default: Private IP: 192.168.100.156
==> outscale-bsu.default: Pausing after run of step 'StepRunSourceVm'. Press enter to continue.
2023/09/29 12:43:57 packer-plugin-outscale_v1.1.2_x5.0_linux_amd64 plugin: 2023/09/29 12:43:57 [INFO] Not using winrm communicator, skipping get password...
==> outscale-bsu.default: Pausing after run of step 'StepGetPassword'. Press enter to continue.
==> outscale-bsu.default: Using SSH communicator to connect: 192.168.100.156
2023/09/29 12:44:00 packer-plugin-outscale_v1.1.2_x5.0_linux_amd64 plugin: 2023/09/29 12:44:00 [INFO] Waiting for SSH, up to timeout: 5m0s
==> outscale-bsu.default: Waiting for SSH to become available...
2023/09/29 12:44:00 packer-plugin-outscale_v1.1.2_x5.0_linux_amd64 plugin: 2023/09/29 12:44:00 [DEBUG] TCP connection to SSH ip/port failed: dial tcp 192.168.100.156:22: connect: no route to host

Packer try to reach the VM on private IP.

#### with ssh_interface = "public_ip":

[DEBUG] Error getting SSH address: couldn't determine address for vm

Outscale builder: setting shutdown_behavior makes Packer waits indefinitely for VM shutdown

This issue was originally opened by @Hakujou as hashicorp/packer#10497. It was migrated here as a result of the Packer plugin split. The original body of the issue is below.


Overview of the Issue

When defining "shutdown_behaviour", Packer hangs at:

==> osc-bsusurrogate: Stopping the source vm...
    osc-bsusurrogate: Stopping vm, attempt 1
==> osc-bsusurrogate: Waiting for the vm to stop...

Reproduction Steps

Set shutdown_behaviour to terminate, then packer build.

Packer version

Packer v1.6.6

Log Fragments and crash.log files

packerlog.txt

ping @marinsalinas

Neither clean_resource_name or clean_omi_name functions are working

Overview of the Issue

In OSC provider version 1.1.3 when using omi name automatic reformatting functions as specified on packer docs:
mybuild-{{isotime | clean_resource_name}}" will become mybuild-2017-10-18t02-06-30z
will raise an error: function "clean_resource_name" not defined
Replacing clean_resource_name by the Outscale plugin recommended clean_omi_name raises an error: function "clean_omi_name" not defined .

Reproduction Steps

Create a packer configuration with the OSC provider version 1.1.3
Setup timestamp naming on the image name with: omi_name = "$my-base-name-{{isotime | clean_resource_name}}"
Use command 'packer validate .' to validate your build
This will rise an error

Now try with omi_name = "$my-base-name-{{isotime | clean_omi_name}}"
Use command 'packer validate .' to validate your build
This will rise an error

Plugin and Packer version

From packer version 1.9.4

Simplified Packer Buildfile

packer {
  required_plugins {
    outscale = {
      version = ">=v1.1.3"
      source  = "github.com/outscale/outscale"
    }
  }
}

source "outscale-bsu" "my_image" {
    launch_block_device_mappings {
        delete_on_vm_deletion = true
        device_name = "/dev/xvdf"
    }
    source_omi_filter {
        filters = {
            image-name          = "Ubuntu-20.04-2021.02.10-5"
            root-device-type    = "ebs"
            virtualization-type = "hvm"
        }
	    owners = ["Outscale"]
        most_recent = true
    }
    source_omi = "${var.omi}"
}

build {
  name = "worker_image"
  source "source.outscale-bsu.quetzal" {
    omi_name = "worker-{{isotime | clean_resource_name}}"
  }
}

Operating system and Environment details

CENTOS 7 Outscale VM

Log Fragments and crash.log files

Error: invalid 'omi_name': template: root:1: function "clean_resource_name" not defined in:

worker-{{isotime | clean_resource_name}}

  on packer/quetzal_img.pkr.hcl line 28:
  (source code not available)
Error: invalid 'omi_name': template: root:1: function "clean_omi_name" not defined in:

worker-{{isotime | clean_omi_name}}

  on packer/quetzal_img.pkr.hcl line 28:
  (source code not available)

Set the env var `PACKER_LOG=1` for maximum log detail.

Cannot Connect via Private Interface with Outscale Key

Overview of the Issue

Packer is able to connect fine via SSH when using our loaded key in Outscale however, this stopped working when switching the 'ssh_interface' to "private". We are using the 'outscale-bsusurrogate' builder for this.

Reproduction Steps

1.) Use the 'outscale-bsusurrogate' and outscale plugin '1.1.3'
2.) Add in SSH configuration using the following added parameters (this should connect fine)

	ssh_interface = "public_ip"
	ssh_username = "outscale"
	communicator = "ssh"

	ssh_private_key_file = "~/.ssh/outscale-private.rsa"
	ssh_keypair_name = "loaded-key-in-outscale"

3.) Switch the 'ssh_interface' with all other parameters the same (this should fail to connect and timeout)

	ssh_interface = "private_ip"
	ssh_username = "outscale"
	communicator = "ssh"

	ssh_private_key_file = "~/.ssh/outscale-private.rsa"
	ssh_keypair_name = "loaded-key-in-outscale"

Plugin and Packer version

# plugin config
packer {
    required_plugins {
        outscale = {
            version = "1.1.3"
            source  = "github.com/outscale/outscale"
        }
    }
}

# packer version
Packer v1.9.1

Simplified Packer Buildfile

For the build, extracted the SSH parameters and provided them below. Was able to confirm that by only switch the 'ssh_interface', packer was no longer able to connect via SSH.

-Working Config-

source "outscale-bsusurrogate" "linux" {
	...
	ssh_interface = "public_ip"
	ssh_username = "outscale"
	communicator = "ssh"

	ssh_private_key_file = "~/.ssh/outscale-infrastructure.rsa"
	ssh_keypair_name = "outscale-infrastructure"
}

build {
    sources = [ 
        "source.outscale-bsusurrogate.linux" 
    ]
}

-Not Working Config-

source "outscale-bsusurrogate" "linux" {
	...
	ssh_interface = "private_ip"
	ssh_username = "outscale"
	communicator = "ssh"

	ssh_private_key_file = "~/.ssh/outscale-infrastructure.rsa"
	ssh_keypair_name = "outscale-infrastructure"
}

build {
    sources = [ 
        "source.outscale-bsusurrogate.linux" 
    ]
}

Operating system and Environment details

Executing Packer on Windows Server 2019 hosted in Outscale.

Log Fragments and crash.log files

{"ResponseContext":{"RequestId":"2d802836-cf2e-4797-b779-d39a7d94a12d"},"Vms":[{"VmType":"tinav5.c4r8p1","VmInitiatedShutdownBehavior":"stop","State":"running","StateReason":"","RootDeviceType":"ebs","RootDeviceName":"/dev/sda1","IsSourceDestChecked":true,"KeypairName":"outscale-infrastructure","PublicIp":"216.168.194.46","ImageId":"ami-66ff5bda","PublicDnsName":"ows-216-168-194-46.us-east-2.compute.outscale.com","DeletionProtection":false,"Architecture":"x86_64","NestedVirtualization":false,"BlockDeviceMappings":[{"DeviceName":"/dev/sda1","Bsu":{"VolumeId":"vol-2f714b45","State":"attached","LinkDate":"2024-02-02T16:08:18.132Z","DeleteOnVmDeletion":true}},{"DeviceName":"/dev/xvdf","Bsu":{"VolumeId":"vol-504e73d2","State":"attached","LinkDate":"2024-02-02T16:08:18.132Z","DeleteOnVmDeletion":true}}],"VmId":"i-219f55b1","ReservationId":"r-0f89df03","Hypervisor":"xen","Placement":{"Tenancy":"default","SubregionName":"us-east-2a"},"ProductCodes":["0001"],"CreationDate":"2024-02-02T16:08:18.132Z","UserData":"","PrivateIp":"10.17.8.113","SecurityGroups":[{"SecurityGroupName":"packer_osc_65bd136f-7d27-7000-ac93-6a2fc2e55883","SecurityGroupId":"sg-498f8efc"}],"BsuOptimized":false,"LaunchNumber":0,"Performance":"highest","Tags":[{"Value":"Packer Builder","Key":"Name"}],"PrivateDnsName":"ip-10-17-8-113.us-east-2.compute.internal"}]}
2024/02/02 16:08:33 ui: �[0;32m    outscale-bsusurrogate.linux: Public DNS: ows-216-168-194-46.us-east-2.compute.outscale.com�[0m
2024/02/02 16:08:33 ui: �[0;32m    outscale-bsusurrogate.linux: Public IP: 216.168.194.46�[0m
2024/02/02 16:08:33 ui: �[0;32m    outscale-bsusurrogate.linux: Private IP: 10.17.8.113�[0m
2024/02/02 16:08:37 packer-plugin-outscale_v1.1.3_x5.0_windows_amd64.exe plugin: 2024/02/02 16:08:37 [INFO] Not using winrm communicator, skipping get password...
2024/02/02 16:08:39 ui: �[1;32m==> outscale-bsusurrogate.linux: Using SSH communicator to connect: 10.17.8.113�[0m
2024/02/02 16:08:39 packer-plugin-outscale_v1.1.3_x5.0_windows_amd64.exe plugin: 2024/02/02 16:08:39 [INFO] Waiting for SSH, up to timeout: 5m0s
2024/02/02 16:08:39 ui: �[1;32m==> outscale-bsusurrogate.linux: Waiting for SSH to become available...�[0m
2024/02/02 16:08:54 packer-plugin-outscale_v1.1.3_x5.0_windows_amd64.exe plugin: 2024/02/02 16:08:54 [DEBUG] TCP connection to SSH ip/port failed: dial tcp 10.17.8.113:22: i/o timeout
2024/02/02 16:09:14 packer-plugin-outscale_v1.1.3_x5.0_windows_amd64.exe plugin: 2024/02/02 16:09:14 [DEBUG] TCP connection to SSH ip/port failed: dial tcp 10.17.8.113:22: i/o timeout
2024/02/02 16:09:34 packer-plugin-outscale_v1.1.3_x5.0_windows_amd64.exe plugin: 2024/02/02 16:09:34 [DEBUG] TCP connection to SSH ip/port failed: dial tcp 10.17.8.113:22: i/o timeout
2024/02/02 16:09:54 packer-plugin-outscale_v1.1.3_x5.0_windows_amd64.exe plugin: 2024/02/02 16:09:54 [DEBUG] TCP connection to SSH ip/port failed: dial tcp 10.17.8.113:22: i/o timeout
2024/02/02 16:10:14 packer-plugin-outscale_v1.1.3_x5.0_windows_amd64.exe plugin: 2024/02/02 16:10:14 [DEBUG] TCP connection to SSH ip/port failed: dial tcp 10.17.8.113:22: i/o timeout
2024/02/02 16:10:34 packer-plugin-outscale_v1.1.3_x5.0_windows_amd64.exe plugin: 2024/02/02 16:10:34 [DEBUG] TCP connection to SSH ip/port failed: dial tcp 10.17.8.113:22: i/o timeout
2024/02/02 16:10:54 packer-plugin-outscale_v1.1.3_x5.0_windows_amd64.exe plugin: 2024/02/02 16:10:54 [DEBUG] TCP connection to SSH ip/port failed: dial tcp 10.17.8.113:22: i/o timeout
2024/02/02 16:11:14 packer-plugin-outscale_v1.1.3_x5.0_windows_amd64.exe plugin: 2024/02/02 16:11:14 [DEBUG] TCP connection to SSH ip/port failed: dial tcp 10.17.8.113:22: i/o timeout
2024/02/02 16:11:34 packer-plugin-outscale_v1.1.3_x5.0_windows_amd64.exe plugin: 2024/02/02 16:11:34 [DEBUG] TCP connection to SSH ip/port failed: dial tcp 10.17.8.113:22: i/o timeout
2024/02/02 16:11:54 packer-plugin-outscale_v1.1.3_x5.0_windows_amd64.exe plugin: 2024/02/02 16:11:54 [DEBUG] TCP connection to SSH ip/port failed: dial tcp 10.17.8.113:22: i/o timeout
2024/02/02 16:12:14 packer-plugin-outscale_v1.1.3_x5.0_windows_amd64.exe plugin: 2024/02/02 16:12:14 [DEBUG] TCP connection to SSH ip/port failed: dial tcp 10.17.8.113:22: i/o timeout
2024/02/02 16:12:34 packer-plugin-outscale_v1.1.3_x5.0_windows_amd64.exe plugin: 2024/02/02 16:12:34 [DEBUG] TCP connection to SSH ip/port failed: dial tcp 10.17.8.113:22: i/o timeout
2024/02/02 16:12:54 packer-plugin-outscale_v1.1.3_x5.0_windows_amd64.exe plugin: 2024/02/02 16:12:54 [DEBUG] TCP connection to SSH ip/port failed: dial tcp 10.17.8.113:22: i/o timeout
2024/02/02 16:13:14 packer-plugin-outscale_v1.1.3_x5.0_windows_amd64.exe plugin: 2024/02/02 16:13:14 [DEBUG] TCP connection to SSH ip/port failed: dial tcp 10.17.8.113:22: i/o timeout
2024/02/02 16:13:34 packer-plugin-outscale_v1.1.3_x5.0_windows_amd64.exe plugin: 2024/02/02 16:13:34 [DEBUG] TCP connection to SSH ip/port failed: dial tcp 10.17.8.113:22: i/o timeout
2024/02/02 16:13:39 ui error: �[1;31m==> outscale-bsusurrogate.linux: Timeout waiting for SSH.�[0m
2024/02/02 16:13:39 packer-plugin-outscale_v1.1.3_x5.0_windows_amd64.exe plugin: 2024/02/02 16:13:39 [DEBUG] SSH wait cancelled. Exiting loop.

Please use semantic MAJOR.MINOR.PATCH accordingly

Hi Outscale !

Beforehand, many thanks for the upgrade of the packer plugin.

You just released the 1.0.6 with a lot of major changes according to the diff. It breaks for me:

1680272967,,ui,error,Build 'outscale-bsu.default' errored after 1 millisecond 552 microseconds: Error querying OMI: The variable region in the server URL has invalid value . Must be [ap-northeast-1 cloudgouv-eu-west-1 eu-west-2 us-east-2 us-west-1]

I use constraints of this type in my configuration, and I believe that I should not have this kind of concern:

packer {
  required_plugins {
    outscale = {
      version = "~> 1.0.0"
      source  = "github.com/outscale/outscale"
    }
  }
}

Is it possible to be more vigilant about versioning in the future?

Regarding the bug, I still have to do some debugging but I lack of time before the weekend to check and open a bugreport if appropriate.

Thank you

Use of owner-alias field for owners field in Outscale builders

This issue was originally opened by @skelkey as hashicorp/packer#10052. It was migrated here as a result of the Packer plugin split. The original body of the issue is below.


Community Note

Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request.
If you are interested in working on this issue or have submitted a pull request, please leave a comment.

Description

It's not possible to filter image by owner-alias instead of owner-id. When I'm searching for an image, I would filter on Outscale account by using it's owner alias. (cc @Hakujou)

The list of owner-id could mix owner-id and owner-alias to filter the list of image.

Use Case(s)

Select the latest Outscale official image instead of fixing it by its id.

error with the builder outscale-chroot

Hello,

I am actually trying to create an Image with the Builder outscale-chroot, but it seems that there is some issue during the mounting step of the new volume :
"
==> outscale-chroot.linux: Mounting the root device...
==> outscale-chroot.linux: Error mounting root volume: exit status 32
==> outscale-chroot.linux: Stderr: mount: /mnt/packer-outscale-chroot-volumes/xvdf: wrong fs type, bad option, bad superblock on /dev/sda, missing codepage or helper program, or other error.
==> outscale-chroot.linux:
==> outscale-chroot.linux: Detaching BSU volume...
==> outscale-chroot.linux: Deleting the created BSU volume...
Build 'outscale-chroot.linux' errored after 17 seconds 800 milliseconds: Error mounting root volume: exit status 32
Stderr: mount: /mnt/packer-outscale-chroot-volumes/xvdf: wrong fs type, bad option, bad superblock on /dev/sda, missing codepage or helper program, or other error.
"

Could you please have a look on it, and try to fix this issue?
I am available if you need more information (used template, more logs...)

Many thanks.

Using Data Sources to improve template

Data sources allow data to be fetched or computed for use elsewhere in local and configuration.
Use of data sources allows a Builder to make use of information defined outside of Packer.

A data source can output one or more attributes, which can be used by adding their key name to the data source unique identifier, like data....

Example:
"data.amazon-ami.example" {
id = "ami12345"
name = "MyAMI"
creation_date = "01/01/2021"
owner = "123456789"
owner_name = "Some Name"
tags = {"tag1": "value"}
}

See doc https://www.packer.io/docs/templates/hcl_templates/datasources

Unable to mark an omi as public when no omi_account_ids specified

Overview of the Issue

There is a parameter called global_permission marking an omi as public when set to true. It's handled during the update step. When omi_account_ids and snapshot_account_ids aren't specified, the step is completely skipped whatever the value of global_permission. Cf. step_update_omi.go line 38

Reproduction Steps

Set global_permission to true without setting omi_account_ids

Plugin and Packer version

From packer 1.2.0

New AK/SK environment variables and configuration files

Community Note

Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request.
If you are interested in working on this issue or have submitted a pull request, please leave a comment.

Description

Outscale does now have a standard of environment variables and config files for its API configuration that we'd like to see implemented in Packer to have a consistent scheme between all Outscale tools.

This is the new environment variables:

Name Type Example Description
OSC_ACCESS_KEY string F4K4T706S9XKGIABNWB9 Access Key
OSC_SECRET_KEY string E4XJE8EJ98ZEJ18E4J9ZE84J19Q8E1J9S87ZEZEJ5E41K Secret Key
OSC_X509_CLIENT_CERT string /etc/secret/client.crt Full path to client certificate (.crt, public part)
OSC_X509_CLIENT_KEY string /etc/secret/client.key Full path to client key related to certificate (.key, secret part)
OSC_PROTOCOL string https Protocol to use: https (default) or http
OSC_METHOD string post HTTP method to use: "post" or "get" (default is "post")
OSC_REGION string eu-west-2  
OSC_ENDPOINT_API string api.eu-west-2.outscale.com/api/v1 Endpoint of Outscale API (without protocol)
OSC_PROFILE string default Profile to use in configuration file (default is "default")

(Those AK/SK are example only and not tied to any account, no worries)
The configuration file is located in ~/.osc/config.json and looks like this:

{
  "default": {
    "access_key": "xxxx",
    "secret_key": "xxxx",
    "x509_client_cert": "/etc/secret/client.crt",
    "x509_client_cert": "/etc/secret/client.key",
    "protocol": "https",
    "method": "post",
    "region": "us-east-2"
    "endpoints": {
      "api": "api.eu-west-2.outscale.com/api/v1"
    }
  }
}

The new environment variables should be evaluated first, with a fallback to the legacy (current) ones if they're not defined.
A new profile setting should also be added to Packer configuration to define which profile needs to be used in the config file (if config file is used), and would be set to "default" if the field is omitted.

Maybe not the right tool for my need

Hi,

I need to build a custom OMI for Outscale. I don't want to start with the centos OMI present in the marketplace because it doesn't satisfy my requirements for partitioning. So in the past,I've already work with packer and vsphere-iso to boot from an iso or an url and download a kickstart for installing my RHEL/CentOS. But I don't see how to achieve the same things with osc-bsusurrogate or osc-chroot. I miss something? Maybe I can achieve this with an other method?

Thank you for your help.

My surrogate_centos-8-stream.json.pkr.hcl :

source "osc-bsusurrogate" "autogenerated_1" {
access_key = "my_ak"
associate_public_ip_address = true
launch_block_device_mappings {
delete_on_vm_deletion = false
device_name = "/dev/xvdf"
iops = 300
volume_size = 10
volume_type = "io1"
}
omi_block_device_mappings {
device_name = "/dev/sda2"
volume_size = 10
volume_type = "standard"
}
omi_description = "custom centos"
omi_name = "packer-msi"
omi_root_device {
delete_on_vm_deletion = true
device_name = "/dev/sda1"
source_device_name = "/dev/xvdf"
volume_size = 10
volume_type = "standard"
}
omi_virtualization_type = "hvm"
region = "eu-west-2"
secret_key = "my_secretkey"
source_omi = "ami-0dd0ab23"
ssh_username = "outscale"
subnet_id = "subnet-id"
subregion_name = "eu-west-2a"
vm_type = "t2.medium"
}
build {
sources = ["source.osc-bsusurrogate.autogenerated_1"]
}

My config.pkr.hcl :

packer {
required_plugins {
outscale = {
version = ">= 1.0.0"
source = "github.com/hashicorp/outscale"
}
}
}

My packer command :

docker run --rm\ --platform linux/amd64 \ -vpwd:/workspace -w /workspace \ -e PACKER_PLUGIN_PATH=/workspace/.packer.d/plugins \ hashicorp/packer:latest \ init config.pkr.hcl && packer build .

The output command (same with -debug ) :

`
osc-bsusurrogate.autogenerated_1: output will be in this color.

==> osc-bsusurrogate.autogenerated_1: Prevalidating OMI Name: packer-msi
osc-bsusurrogate.autogenerated_1: Found Image ID: ami-0dd0ab23
==> osc-bsusurrogate.autogenerated_1: Creating temporary keypair: packer_615d5585-bcee-1963-0880-68888745700b
==> osc-bsusurrogate.autogenerated_1: Creating temporary PublicIp for instance
==> osc-bsusurrogate.autogenerated_1: Creating temporary security group for this instance: packer_osc_615d5586-0f48-8c2d-a421-a194c324af49
==> osc-bsusurrogate.autogenerated_1: Authorizing access to port 22 from 0.0.0.0/0 in the temporary security group...
==> osc-bsusurrogate.autogenerated_1: Launching a source OUTSCALE vm...
==> osc-bsusurrogate.autogenerated_1: Adding tags to source vm
osc-bsusurrogate.autogenerated_1: Vm ID: i-5624caa7
==> osc-bsusurrogate.autogenerated_1: Waiting for vm (i-5624caa7) to become ready...
osc-bsusurrogate.autogenerated_1: Adding tag: "Name": "Packer Builder"
==> osc-bsusurrogate.autogenerated_1: Linking temporary PublicIp eipalloc-908b0ae4 to instance i-5624caa7
==> osc-bsusurrogate.autogenerated_1: Using SSH communicator to connect: 80.247.0.99
==> osc-bsusurrogate.autogenerated_1: Waiting for SSH to become available...
==> osc-bsusurrogate.autogenerated_1: Connected to SSH!
==> osc-bsusurrogate.autogenerated_1: Stopping the source vm...
osc-bsusurrogate.autogenerated_1: Stopping vm, attempt 1
==> osc-bsusurrogate.autogenerated_1: Waiting for the vm to stop...
==> osc-bsusurrogate.autogenerated_1: Creating snapshot of EBS Volume vol-fa17b08f...
==> osc-bsusurrogate.autogenerated_1: Registering the OMI...
==> osc-bsusurrogate.autogenerated_1: Error registering OMI: 400 Bad Request
==> osc-bsusurrogate.autogenerated_1: Removing snapshots since we cancelled or halted...
==> osc-bsusurrogate.autogenerated_1: Provisioning step had errors: Running the cleanup provisioner, if present...
==> osc-bsusurrogate.autogenerated_1: Terminating the source OUTSCALE vm...
==> osc-bsusurrogate.autogenerated_1: Cleaning up any extra volumes...
==> osc-bsusurrogate.autogenerated_1: Deleting temporary security group...
==> osc-bsusurrogate.autogenerated_1: Deleting temporary PublicIp...
==> osc-bsusurrogate.autogenerated_1: Deleting temporary keypair...
Build 'osc-bsusurrogate.autogenerated_1' errored after 2 minutes 28 seconds: Error registering OMI: 400 Bad Request

==> Wait completed after 2 minutes 28 seconds

==> Some builds didn't complete successfully and had errors:
--> osc-bsusurrogate.autogenerated_1: Error registering OMI: 400 Bad Request

==> Builds finished but no artifacts were created.
`

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.