hashicorp / packer-plugin-googlecompute

Packer plugin for Google Compute Builder
https://www.packer.io/docs/builders/googlecompute
Mozilla Public License 2.0
25 stars 54 forks source link

feat: `enable_nested_virtualization` on ephemeral instance #76

Closed guiadco closed 1 year ago

guiadco commented 2 years ago

Description

Actually, the Google Compute Builder is only able to create a image with nested licenses to build a Google Compute image but in my case, I need to use Packer in Packer to create a legacy image (qcow2) inside the Google Compute Builder.

But we get this error:

qemu-system-x86_64: failed to initialize KVM

The Google Compute Builder doesn't be able to use the enable_nested_virtualization on ephemeral instance.

Use Case(s)

It force to maintain a special image apart this section whereas Google Compute Engine have a recommended option for that.

Potential configuration

It could be great to use like terraform:

  advanced_machine_features {
    enable_nested_virtualization = true
  }

Potential References

Recommended. Enable nested virtualization directly on a new or existing VM by setting the enableNestedVirtualization field to true while creating the VM or by updating the VM. 

This is the recommended method because it doesn't require that you create a custom image or use the special license key.