Issues with Firecracker + Terraform 0.13.5

Hey there!

Thanks for this great open source project. Right now I’m trying out firecracker along with terraform and currently facing some issues.

From the opennebula webui everything works but if I use terraform I cannot deploy a vm.


Versions of the related components and OS (frontend, hypervisors, VMs):

OpenNebula 5.12.0.3
Terraform v0.13.5

Steps to reproduce:

  1. Install opennebula
  2. Grab example from https://registry.terraform.io/providers/OpenNebula/opennebula/latest/docs/resources/virtual_machine
  3. Download terraform 0.13.5
  4. terraform apply

Current results:

Mon Feb 8 13:00:03 2021 [Z0][VM][I]: New state is ACTIVE
Mon Feb 8 13:00:03 2021 [Z0][VM][I]: New LCM state is PROLOG
Mon Feb 8 13:00:12 2021 [Z0][VM][I]: New LCM state is BOOT
Mon Feb 8 13:00:12 2021 [Z0][VMM][I]: Generating deployment file: /var/lib/one/vms/13/deployment.0
Mon Feb 8 13:00:13 2021 [Z0][VMM][I]: Successfully execute transfer manager driver operation: tm_context.
Mon Feb 8 13:00:13 2021 [Z0][VMM][I]: pre: Running /var/tmp/one/vnm/fw/pre.d/firecracker
Mon Feb 8 13:00:13 2021 [Z0][VMM][I]: pre:
Mon Feb 8 13:00:13 2021 [Z0][VMM][I]: ExitCode: 0
Mon Feb 8 13:00:13 2021 [Z0][VMM][I]: Successfully execute network driver operation: pre.
Mon Feb 8 13:00:18 2021 [Z0][VMM][I]: Command execution fail: cat << EOT | /var/tmp/one/vmm/firecracker/deploy '/var/lib/one//datastores/0/13/deployment.0' 'localhost' 13 localhost
Mon Feb 8 13:00:18 2021 [Z0][VMM][I]: MicroVM process did not start.
Mon Feb 8 13:00:18 2021 [Z0][VMM][I]: ExitCode: 255
Mon Feb 8 13:00:19 2021 [Z0][VMM][I]: clean: Running /var/tmp/one/vnm/fw/clean.d/firecracker
Mon Feb 8 13:00:19 2021 [Z0][VMM][I]: clean:
Mon Feb 8 13:00:19 2021 [Z0][VMM][I]: ExitCode: 0
Mon Feb 8 13:00:19 2021 [Z0][VMM][I]: Successfully execute network driver operation: clean.
Mon Feb 8 13:00:19 2021 [Z0][VMM][I]: Failed to execute virtualization driver operation: deploy.
Mon Feb 8 13:00:19 2021 [Z0][VMM][E]: Error deploying virtual machine
Mon Feb 8 13:00:19 2021 [Z0][VM][I]: New LCM state is BOOT_FAILURE

Terraform output:

Error: Error waiting for virtual machine (13) to be in state RUNNING: VM (ID:13) entered fail state, error:                       

on main.tf line 7, in resource "opennebula_virtual_machine" "demo":
7: resource "opennebula_virtual_machine" "demo" {

Nevermind I managed to create bunch of microVms :slight_smile:

provider "opennebula" {
  endpoint      = "http://192.168.2.10:2633/RPC2"
  username      = "oneadmin"
  password      = "somepass"
}


resource "opennebula_virtual_machine" "importvm" {
    count       = 3
    name        = "test0${count.index}"
    permissions = "600"
    template_id = 4

    disk {
        driver = "raw"
        target = "vda"
        image_id = data.opennebula_image.osimage.id
    }

    graphics {
        listen = "0.0.0.0"
        type   = "VNC"
        keymap = "es"
    }
}


data "opennebula_image" "osimage" {
  name = "centos7"
}


output "ip" {
    value = opennebula_virtual_machine.importvm.*.ip
}
1 Like