Comments (7)
Can you share the terraform file and the output from terraform with the error please ?
from terraform-provider-opennebula.
$ terraform init
Initializing the backend...
Initializing provider plugins...
- Using previously-installed terraform-providers/opennebula v0.2.2
The following providers do not have any version constraints in configuration,
so the latest version was installed.
To prevent automatic upgrades to new major versions that may contain breaking
changes, we recommend adding version constraints in a required_providers block
in your configuration, with the constraint strings suggested below.
* terraform-providers/opennebula: version = "~> 0.2.2"
Terraform has been successfully initialized!
You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.
If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.
$ cat vm.tf
resource "opennebula_virtual_machine" "test0" {
name = "test0"
template_id = 0
}
resource "opennebula_virtual_machine" "test1" {
name = "test1"
template_id = 1
}
$ terraform apply
An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
+ create
Terraform will perform the following actions:
# opennebula_virtual_machine.test0 will be created
+ resource "opennebula_virtual_machine" "test0" {
+ cpu = (known after apply)
+ gid = (known after apply)
+ gname = (known after apply)
+ id = (known after apply)
+ instance = (known after apply)
+ ip = (known after apply)
+ lcmstate = (known after apply)
+ memory = (known after apply)
+ name = "test0"
+ pending = false
+ permissions = (known after apply)
+ state = (known after apply)
+ template_id = 0
+ timeout = 3
+ uid = (known after apply)
+ uname = (known after apply)
+ vcpu = (known after apply)
+ disk {
+ driver = (known after apply)
+ image_id = (known after apply)
+ size = (known after apply)
+ target = (known after apply)
}
+ graphics {
+ keymap = (known after apply)
+ listen = (known after apply)
+ port = (known after apply)
+ type = (known after apply)
}
+ nic {
+ ip = (known after apply)
+ mac = (known after apply)
+ model = (known after apply)
+ network = (known after apply)
+ network_id = (known after apply)
+ nic_id = (known after apply)
+ physical_device = (known after apply)
+ security_groups = (known after apply)
}
+ os {
+ arch = (known after apply)
+ boot = (known after apply)
}
+ vmgroup {
+ role = (known after apply)
+ vmgroup_id = (known after apply)
}
}
# opennebula_virtual_machine.test1 will be created
+ resource "opennebula_virtual_machine" "test1" {
+ cpu = (known after apply)
+ gid = (known after apply)
+ gname = (known after apply)
+ id = (known after apply)
+ instance = (known after apply)
+ ip = (known after apply)
+ lcmstate = (known after apply)
+ memory = (known after apply)
+ name = "test1"
+ pending = false
+ permissions = (known after apply)
+ state = (known after apply)
+ template_id = 1
+ timeout = 3
+ uid = (known after apply)
+ uname = (known after apply)
+ vcpu = (known after apply)
+ disk {
+ driver = (known after apply)
+ image_id = (known after apply)
+ size = (known after apply)
+ target = (known after apply)
}
+ graphics {
+ keymap = (known after apply)
+ listen = (known after apply)
+ port = (known after apply)
+ type = (known after apply)
}
+ nic {
+ ip = (known after apply)
+ mac = (known after apply)
+ model = (known after apply)
+ network = (known after apply)
+ network_id = (known after apply)
+ nic_id = (known after apply)
+ physical_device = (known after apply)
+ security_groups = (known after apply)
}
+ os {
+ arch = (known after apply)
+ boot = (known after apply)
}
+ vmgroup {
+ role = (known after apply)
+ vmgroup_id = (known after apply)
}
}
Plan: 2 to add, 0 to change, 0 to destroy.
Do you want to perform these actions?
Terraform will perform the actions described above.
Only 'yes' will be accepted to approve.
Enter a value: yes
opennebula_virtual_machine.test1: Creating...
opennebula_virtual_machine.test0: Creating...
opennebula_virtual_machine.test1: Still creating... [10s elapsed]
opennebula_virtual_machine.test1: Creation complete after 17s [id=10]
Error: cpu is mandatory as template_id is not used
on vm.tf line 1, in resource "opennebula_virtual_machine" "test0":
1: resource "opennebula_virtual_machine" "test0" {
from terraform-provider-opennebula.
$ onetemplate list
ID USER GROUP NAME REGTIME
2 oneadmin oneadmin ci106 11/06 23:01:03
1 oneadmin oneadmin ci1404 11/04 21:03:34
0 oneadmin oneadmin ci2004 11/04 21:03:20
$ onevm list
ID USER GROUP NAME STAT CPU MEM HOST TIME
10 oneadmin oneadmin test1 runn 1 1024M 4830t 0d 00h06
from terraform-provider-opennebula.
OK
This is surprising while test are OK but I will add a better check for the case id = 0.
Thanks
from terraform-provider-opennebula.
i think i ran into the similar error with image_id = 0. please also check on that. thanks.
from terraform-provider-opennebula.
about the image_id issue: it is already fixed by the PR #75
So in the next release 0.3.0 you should have both fixes
from terraform-provider-opennebula.
thanks.
from terraform-provider-opennebula.
Related Issues (20)
- `opennebula_marketplace_appliance`: Tainted resource cannot be replaced HOT 1
- `opennebula_marketplace_appliance`: unexpected state 'LOCKED', wanted target 'READY'
- Provider 1.4.0-rc2 crashes when changing marketplace appliance version
- Wrong `random_passwd` type
- Introduce `opennebula_virtual_machine_disk_attachment` to prevent issues when replacing image HOT 1
- `v1.4.0` documentation fixes
- Issue with Services: Unable to Create Reserve from Network HOT 6
- Security group management leads to detach and attach of the NIC HOT 3
- How to set the owner of a virtual network? HOT 3
- ```cpumodel``` Crash report HOT 1
- virtual machine (ID: 14): unexpected state 'POWEROFF', wanted target 'RUNNING'. last error: %!s(<nil>) HOT 2
- Impossible to update context of Virtual Router instances
- Add memory, CPU and disk costs in the template resource HOT 2
- It is not possible to add more than a PCI device (passthrough) to a VM HOT 1
- Error creating Ceph Datastore: "SYSTEM datastores cannot have DS_MAD defined"
- Trailing space in `CEPH_HOST` when creating a Ceph datastore
- Missing Data Source for opennebula_virtual_network_address_range
- `opennebula_service` does not honor idempotence (OneKE) HOT 2
- `opennebula_virtual_router_nic`: Add floating_only argument
- Extend `nic` section, add missing arguments like METHOD, GATEWAY or DNS..
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from terraform-provider-opennebula.