dbgeek / terraform-provider-ovm

Terraform provider to manage Oracle OVM resources
MIT License
12 stars 7 forks source link

VM is created but not started - error occurred parsing the JSON #12

Closed luboss79 closed 5 years ago

luboss79 commented 5 years ago

terraform version: v0.11.14 OVM server and manager: 3.4.6.2105 VM template: Oracle Linux 6.9 PVHVM (64 bit, downloaded from the oracle site) I got this error with terraform apply: Error: Error applying plan:

1 error occurred:

issue.txt

luboss79 commented 5 years ago

terraform.tfvars: vm_repositoryid = "0004fb0000030000ed3a70d7dcdcfb3c" serverpoolid = "0004fb000002000032ae8e155371e2df" vd_repositoryid = "0004fb0000030000ed3a70d7dcdcfb3c" networkid = "10fdd6e4a9" virtualnicid = "0004fb0000070000281c4ba02f976c32" template_vmid = "0004fb00000600008a3bb5981692138f" vm_diskmappingid = "0004fb000013000098a5d8c323b8468d"

-----------------------------------------------------------------------------------------------------

OVM credentials

-----------------------------------------------------------------------------------------------------

ovm_username = "admin" ovm_password = "XXX" ovm_endpoint = "https://111.11.11.111:7002"

vm.tf: //Creating VmCloneCustomizer resource "ovm_vmcd" "oe6_tmpl_cst" { vmid = "${var.template_vmid}" name = "oe6_tmpl_cst" description = "Desc oel6 cust" }

//Defining Vm Clone Storage Mapping resource "ovm_vmcsm" "oel6_vmclonestoragemapping" { vmdiskmappingid = "${var.vm_diskmappingid}" vmclonedefinitionid = "${ovm_vmcd.oe6_tmpl_cst.id}" repositoryid = "${var.vm_repositoryid}" name = "oel_cust_storage" clonetype = "SPARSE_COPY" }

//Defining Vm Clone Network Mappings. resource "ovm_vmcnm" "oel6_vmclonenetworkmapping" { networkid = "${var.networkid}" vmclonedefinitionid = "${ovm_vmcd.oe6_tmpl_cst.id}" virtualnicid = "${var.virtualnicid}" name = "oel_cust_network" }

resource "ovm_vm" "cloneoel6" { name = "ol6_clone" repositoryid = "${var.vm_repositoryid}" //Where vm.cfg should be stored serverpoolid = "${var.serverpoolid}" vmdomaintype = "XEN_HVM_PV" clonevmid = "${var.template_vmid}" vmclonedefinitionid = "${ovm_vmcd.oe6_tmpl_cst.id}" cpucountlimit = "4" cpucount = "2" memory = "4096" hugepagesenabled = "False"

sendmessages {
  "com.oracle.linux.network.hostname"    = "ol6_clone"
  "com.oracle.linux.network.device.0"    = "eth0"
  "com.oracle.linux.network.bootproto.0" = "dhcp"
  "com.oracle.linux.network.onboot.0"    = "yes"
  "com.oracle.linux.root-password"       = "XXX"
}

depends_on = ["ovm_vmcnm.oel6_vmclonenetworkmapping", "ovm_vmcsm.oel6_vmclonestoragemapping"] }

luboss79 commented 5 years ago

FIXED: problem was in the key vmdomaintype: "XEN_HVM_PV" After changing to vmdomaintype: "XEN_HVM" the VM was started successfully