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

[gogolecompute] Support for more than one disk #8899

Closed
pmontanari opened this issue Mar 18, 2020 · 7 comments
Closed

[gogolecompute] Support for more than one disk #8899

pmontanari opened this issue Mar 18, 2020 · 7 comments

Comments

@pmontanari
Copy link

Feature Description

googlecompute builder is missing the fearture to attach multiple disks (like for for Amazon AWS: ami_block_device_mappings) even though Machine images support it

Thanks
Patrick

@azr
Copy link
Contributor

azr commented Mar 18, 2020

Hey @pmontanari thanks for opening; I think this is a neat idea.

The following piece of code is what adds a drive to the instance and is an array:

Disks: []*compute.AttachedDisk{
{
Type: "PERSISTENT",
Mode: "READ_WRITE",
Kind: "compute#attachedDisk",
Boot: true,
AutoDelete: false,
InitializeParams: &compute.AttachedDiskInitializeParams{
SourceImage: c.Image.SelfLink,
DiskSizeGb: c.DiskSizeGb,
DiskType: fmt.Sprintf("zones/%s/diskTypes/%s", zone.Name, c.DiskType),
},
},
},

So I think adding a disks option to the builder would be a good idea.

{
  "disks" : [
    {"type": "...", "size": "...", "name":"..."}
  ]
}

If you (or anyone) have time to do it we would love to review a PR 🙂 👍

@SwampDragons SwampDragons added this to the 1.5.6 milestone Mar 26, 2020
@SwampDragons SwampDragons modified the milestones: 1.5.6, 1.6.0 May 1, 2020
@chadbean
Copy link

chadbean commented Jun 2, 2020

I need a way to launch an image with multiple disks as well. I was looking into this a bit and it seems like we'd also need a way to save the image with those additional disks which is not supported at the moment in Packer (edit: not possible with Packer + googlecompute).

It looks like Packer uses the Image type which will only create an image with the boot disk. Google recently announced Machine Images which will save create an image with all currently attached disks.

The new MachineImage type is available in the v0.beta package of their compute SDK and Packer uses v1.

Would it make sense to try to switch fully away from the Image to using the newer MachineImage, or maybe it should be a feature that lives alongside the current functionality? Happy to help if I can.

@SwampDragons
Copy link
Contributor

We generally try not to use beta versions of SDKs and APIs, just to help keep Packer stable.

@chadbean
Copy link

chadbean commented Jun 2, 2020

@SwampDragons that makes sense. I wonder if it'd be worth breaking ground on implementing this new "MachineImage" functionality to start preparing for their new API. I'm curious too if this should replace the current imaging functionality or should live alongside it?

@SwampDragons
Copy link
Contributor

I'd say at the very least while MachineImage is a beta feature, it should be alongside rather than replacing.

@ghost
Copy link

ghost commented Apr 19, 2021

This issue has been automatically migrated to hashicorp/packer-plugin-googlecompute#7 because it looks like an issue with that plugin. If you believe this is not an issue with the plugin, please reply to hashicorp/packer-plugin-googlecompute#7.

@ghost
Copy link

ghost commented May 20, 2021

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@hashicorp hashicorp locked as resolved and limited conversation to collaborators May 20, 2021
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants