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

Cannot add VM. Start On Boot selection in cloud-init configuration is invalid. Only 'true' is supported. #3

Open
pontostroy opened this issue Mar 28, 2018 · 4 comments

Comments

@pontostroy
Copy link

ovirt Version 4.2.1.7-1.el7.centos

main.tf with minor change

ovirt_vm.my_vm: Creating...
attached_disks.#: "0" => "1"
attached_disks.1297564481.active: "" => "true"
attached_disks.1297564481.bootable: "" => "true"
attached_disks.1297564481.disk_id: "" => "4039b3c3-5c69-452a-ab5b-44c1a3471bde"
attached_disks.1297564481.interface: "" => "virtio"
2018/03/28 13:26:58 [TRACE] root: eval: *terraform.EvalApply
2018/03/28 13:26:58 [DEBUG] apply: ovirt_vm.my_vm: executing Apply
attached_disks.1297564481.logical_name: "" => ""
attached_disks.1297564481.pass_discard: "" => ""
attached_disks.1297564481.read_only: "" => "false"
attached_disks.1297564481.use_scsi_reservation: "" => "false"
cluster: "" => "QCluster"
name: "" => "my_first_vm"
network_interface.#: "0" => "1"
network_interface.0.boot_proto: "" => "static"
network_interface.0.gateway: "" => "130.20.232.1"
network_interface.0.ip_address: "" => "130.20.232.184"
network_interface.0.label: "" => "eth0"
network_interface.0.subnet_mask: "" => "255.255.255.0"
template: "" => "Blank"
2018/03/28 13:26:59 [TRACE] root: eval: *terraform.EvalWriteState
2018/03/28 13:26:59 [TRACE] root: eval: *terraform.EvalApplyProvisioners
2018/03/28 13:26:59 [TRACE] root: eval: *terraform.EvalIf
2018/03/28 13:26:59 [TRACE] root: eval: *terraform.EvalWriteState
2018/03/28 13:26:59 [TRACE] root: eval: *terraform.EvalWriteDiff
2018/03/28 13:26:59 [TRACE] root: eval: *terraform.EvalApplyPost
2018/03/28 13:26:59 [ERROR] root: eval: *terraform.EvalApplyPost, err: 1 error(s) occurred:

  • ovirt_vm.my_vm: Server Error, Reason: Operation Failed, Detail: [Cannot add VM. Start On Boot selection in cloud-init configuration is invalid. Only 'true' is supported.]
    2018/03/28 13:26:59 [ERROR] root: eval: *terraform.EvalSequence, err: 1 error(s) occurred:
@pontostroy
Copy link
Author

2018-03-28 15:13:06,171+03 INFO [org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector] (default task-13) [a801f714-b81b-4750-b519-28e1682db8f3] EVENT_ID: USER_ADD_DISK(2,020), Add-Disk operation of 'my_first_disk' was initiated by pontostroy 2018-03-28 15:13:06,222+03 INFO [org.ovirt.engine.core.bll.aaa.LogoutSessionCommand] (default task-13) [6fdbd6d3] Running command: LogoutSessionCommand internal: false. 2018-03-28 15:13:06,240+03 INFO [org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector] (default task-13) [6fdbd6d3] EVENT_ID: USER_VDC_LOGOUT(31), User pontostroy connected from '192.168.1.125' using session 'Tap0DRkD9oncDmIj2rcAPO26ULG8DEzRSUB4hSIL1c14kU3uwOQ0t+spHiV1T51i2gdvdjyjOyqHnWZDkuPy6A==' logged out. 2018-03-28 15:13:06,367+03 INFO [org.ovirt.engine.core.sso.utils.AuthenticationUtils] (default task-9) [] User pontostroy successfully logged in with scopes: ovirt-app-api ovirt-ext=token-info:authz-search ovirt-ext=token-info:public-authz-search ovirt-ext=token-info:validate ovirt-ext=token:password-access 2018-03-28 15:13:06,392+03 INFO [org.ovirt.engine.core.bll.aaa.CreateUserSessionCommand] (default task-19) [3fc1ab0d] Running command: CreateUserSessionCommand internal: false. 2018-03-28 15:13:06,471+03 INFO [org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector] (default task-19) [3fc1ab0d] EVENT_ID: USER_VDC_LOGIN(30), User pontostroy connecting from '192.168.1.125' using session 'pM7FvLqQDrJW6aoiBKaPty0aIe82VRXVDVhSLmzW7i1wgkamz+P4Xn7bmGPzS7js4vWcDA/F0+UrWGJ7FEflkg==' logged in. 2018-03-28 15:13:06,603+03 INFO [org.ovirt.engine.core.bll.AddVmFromScratchCommand] (default task-19) [7d4c70ee-91a6-43ed-ac58-25970ab49d03] Lock Acquired to object 'EngineLock:{exclusiveLocks='[my_first_vm=VM_NAME]', sharedLocks=''}' 2018-03-28 15:13:06,692+03 WARN [org.ovirt.engine.core.bll.AddVmFromScratchCommand] (default task-19) [] Validation of action 'AddVmFromScratch' failed for user pontostro. Reasons: VAR__ACTION__ADD,VAR__TYPE__VM,VALIDATION_CLOUD_INIT_START_ON_BOOT_INVALID 2018-03-28 15:13:06,693+03 INFO [org.ovirt.engine.core.bll.AddVmFromScratchCommand] (default task-19) [] Lock freed to object 'EngineLock:{exclusiveLocks='[my_first_vm=VM_NAME]', sharedLocks=''}' 2018-03-28 15:13:06,716+03 ERROR [org.ovirt.engine.api.restapi.resource.AbstractBackendResource] (default task-19) [] Operation Failed: [Cannot add VM. Start On Boot selection in cloud-init configuration is invalid. Only 'true' is supported.] 2018-03-28 15:13:06,725+03 INFO [org.ovirt.engine.core.bll.aaa.LogoutSessionCommand] (default task-19) [66a580e9] Running command: LogoutSessionCommand internal: false. 2018-03-28 15:13:06,740+03 INFO [org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector] (default task-19) [66a580e9] EVENT_ID: USER_VDC_LOGOUT(31), User pontostroy connected from '192.168.1.125' using session 'pM7FvLqQDrJW6aoiBKaPty0aIe82VRXVDVhSLmzW7i1wgkamz+P4Xn7bmGPzS7js4vWcDA/F0+UrWGJ7FEflkg==' logged out. 2018-03-28 15:13:06,901+03 INFO [org.ovirt.engine.core.bll.ConcurrentChildCommandsExecutionCallback] (EE-ManagedThreadFactory-engineScheduled-Thread-57) [a801f714-b81b-4750-b519-28e1682db8f3] Command 'AddDisk' (id: '539016f0-3708-4c8c-baf2-46f6f1116d8f') waiting on child command id: '191896f9-5182-4625-aefe-7e9f2e79e0f8' type:'AddImageFromScratch' to complete 2018-03-28 15:13:09,776+03 INFO [org.ovirt.engine.core.bll.tasks.AsyncTaskManager] (EE-ManagedThreadFactory-engineScheduled-Thread-24) [] Polling and updating Async Tasks: 1 tasks, 1 tasks to poll now

@Maigard
Copy link
Member

Maigard commented Mar 29, 2018

I wasn't able to replicate this. I pushed a change that might fix it in 93a15f4. If it doesn't work. Can you include a terraform config and the ovirt version you are using?

@pontostroy
Copy link
Author

it's work.
but first run fails wirh
``
2018/03/30 09:47:56 [ERROR] root: eval: *terraform.EvalApplyPost, err: 1 error(s) occurred:

  • ovirt_vm.my_vm: unexpected end of JSON input
    2018/03/30 09:47:56 [ERROR] root: eval: *terraform.EvalSequence, err: 1 error(s) occurred:

  • ovirt_vm.my_vm: unexpected end of JSON input
    2018/03/30 09:47:56 [TRACE] [walkApply] Exiting eval tree: ovirt_vm.my_vm
    2018/03/30 09:47:56 [TRACE] dag/walk: upstream errored, not walking "provider.ovirt (close)"
    2018/03/30 09:47:56 [TRACE] dag/walk: upstream errored, not walking "meta.count-boundary (count boundary fixup)"
    2018/03/30 09:47:56 [TRACE] dag/walk: upstream errored, not walking "root"
    2018/03/30 09:47:56 [TRACE] Preserving existing state lineage "efa87def-b63a-6f93-688d-9a8b5b1f627e"

Error: Error applying plan:

1 error(s) occurred:

2018/03/30 09:47:56 [DEBUG] plugin: waiting for all plugin processes to complete...

  • ovirt_vm.my_vm: 1 error(s) occurred:

  • ovirt_vm.my_vm: unexpected end of JSON input

``

second run finished with
Apply complete! Resources: 0 added, 1 changed, 0 destroyed.

@pontostroy
Copy link
Author

variable "ovirt_pass" {}

provider "ovirt" {
username = "pontostroy@local"
url = "https://ovirt/api"
password = "${var.ovirt_pass}"
}

resource "ovirt_vm" "my_vm" {
name = "Terraform_fedora"
cluster = "QCluster"

network_interface {
label = "eth0"
boot_proto = "dhcp"

}

attached_disks = [{
disk_id = "${ovirt_disk.my_disk.id}"
bootable = "true"
interface = "virtio"
}]

template = "fedora27-cloud"
}

resource "ovirt_disk" "my_disk" {
name = "terraform_test"
size = 4096
format = "cow"
storage_domain_id = "43d4405f-4760-471c-b8e2-54e187d762e1"
sparse = true
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants