-
Notifications
You must be signed in to change notification settings - Fork 14
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
Maybe not the right tool for my need #42
Comments
Hello @m4nch0t, If you want to create an image from scratch, checkout our examples in this repository (https://github.com/outscale/omi-packer). On the other side, we are currently investigating your example and we will update you on the subject. Best regards, |
Update 1:
|
Thank you for your response, For omi-packer, I've already see it, but don't even try. You use the official qcow2 from CentOS, but I don't want to use it because I don't want this partition scheme (not compliant with CIS hardening guide), and optionally this filesystem (the goal is to use lvm/xfs). Maybe I mistranslate the documentation... |
Here is your hcl fixed: source "osc-bsusurrogate" "autogenerated_1" {
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/xvde"
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"
source_omi = "ami-0dd0ab23"
ssh_username = "outscale"
subregion_name = "eu-west-2a"
vm_type = "t2.medium"
}
build {
sources = ["source.osc-bsusurrogate.autogenerated_1"]
} For your use-case, the |
Thank you, so I've to remove :
Change
With this, I've now : If I keep omi_root_device. device_name="/dev/sda" I still have Nevermind, if this builder is not compliant with my need, don't need to dig further. I'll take another look at osc-chroot |
Hello again, I'm trying to use osc-chroot, with the exact same "basic example", got some typos in the doc.
When I change ami/omi, got :
If I remove it, got the same error with my first custom config :
I've launched a VM (named packer) with packer installed, but maybe I'm not fully awake and miss something in the doc, but I don't see any reference in the documentation of this builder... Best regards |
You are right, thank your for this. We will update the doc. Just to be sure, you are executing packer from a VM from the Outscale cloud ? |
Oh, I mistranslate the doc, I have to run from a packer vm in my vpc, not the local packer who connect to my vm with my key pair. I'll give it a try. |
Ok, I'm now in a fresh install of ami-0dd0ab23 in my vpc, I've installed packer 1.7.6. ==> osc-chroot.autogenerated_1: Error creating lock: mkdir /var/lock/packer-chroot: permission denied If I re run the same command with sudo (or directly with root user) nothing happen, any traffic captured with tcpdump or output in console , even with PACKER_LOG=1. Same behaviour with packer init. |
Hello, |
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 \ -v
pwd:/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.
`
The text was updated successfully, but these errors were encountered: