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

virtual machine (ID: 14): unexpected state 'POWEROFF', wanted target 'RUNNING'. last error: %!s(<nil>) #533

Open
zixelmike opened this issue Mar 18, 2024 · 2 comments

Comments

@zixelmike
Copy link

zixelmike commented Mar 18, 2024

Description

Hello, I try to create VM and run it. But it`s not runing after deploy. Opennebula 6.0.0.2

Terraform and Provider version

provider registry.terraform.io/opennebula/opennebula v1.4.0

Affected resources and data sources

resources network, image, template and VM

Terraform configuration

resource "opennebula_image" "Linux" {
  name = "Linux-1.7.2"
  description = "Linux 1.7.2 Image"
  datastore_id = "1"
  persistent = true
  dev_prefix = "vd"
  driver = "qcow2"
  permissions = "640"
  path = "http://boot.xxxxx.com/linux-nogui15"
  type = "OS"
   timeouts {
     create = "2h"
   }
}

resource "opennebula_virtual_network" "br0" {
  name         = "br0"
  type         = "bridge"
  bridge       = "br0"
  physical_device = "eth0"
  permissions  = "640"
  mtu          = 1500
  gateway      = "10.3.35.254"
  dns          = "8.8.8.8"
  network_mask = "255.255.255.0"
}

resource "opennebula_virtual_network_address_range" "br0range" {
  virtual_network_id = opennebula_virtual_network.br0.id
  ar_type            = "IP4"
  size               = 20
  ip4                = "10.3.35.80"
}

resource "opennebula_template" "desk" {
  name        = "Desk"
  description = "VM template for desk"
  cpu         = 2
  vcpu        = 4
  memory      = 4096
  permissions = "640"

  context = {
    NETWORK      = "YES"
    HOSTNAME     = "$NAME"
    SSH_PUBLIC_KEY = "$USER[SSH_PUBLIC_KEY]"
  }


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

  os {
    arch = "x86_64"
    boot = "disk0"
  }

  features {
    guest_agent = "YES"
    acpi = "YES"
  }

  disk {
    image_id = opennebula_image.Linux.id
    #size     = 15000
    target   = "vda"
    driver   = "qcow2"
  }

  nic {
    network_id      = opennebula_virtual_network.br0.id
    model           = "virtio"
  }

}

resource "opennebula_virtual_machine" "desk" {
  #count = 2

  name        = "Ddesk"
  description = "VM For Desk"
  cpu         = 2
  vcpu        = 4
  memory      = 4096
  permissions = "640"
  template_id = opennebula_template.desk.id


  nic {
    model           = "virtio"
    network_id      = opennebula_virtual_network.br0.id
    ip = "10.3.35.80"
  }
}

Expected behavior

Waiting RUNING state

Actual behavior

│ Error: Failed to wait virtual machine to be in RUNNING state

│ with opennebula_virtual_machine.desk,
│ on default.tf line 101, in resource "opennebula_virtual_machine" "desk":
│ 101: resource "opennebula_virtual_machine" "desk" {

│ virtual machine (ID: 14): unexpected state 'POWEROFF', wanted target 'RUNNING'. last error: %!s()

Steps to Reproduce

terraform plan
terraform apply

Debug output

No response

Panic output

No response

Important factoids

No response

References

No response

@zixelmike
Copy link
Author

I added tags, it runs =)
tags = {
AUTOSTARTVM = "1"
SERVICEUSERVM = "1"
}

Copy link

This issue is stale because it has been open for 30 days with no activity and it has not the 'status: confirmed' label or it is not in a milestone. Remove the 'status: stale' label or comment, or this will be closed in 5 days.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Apr 24, 2024
@frousselet frousselet reopened this Apr 25, 2024
@frousselet frousselet added this to the 1.5.0 milestone Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants