Bug 1348614 - Start rhevm vm with use_cloud_init flag on first boot
Summary: Start rhevm vm with use_cloud_init flag on first boot
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Provisioning
Version: 5.5.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: GA
: 5.7.0
Assignee: Brandon Dunne
QA Contact: luke couzens
URL:
Whiteboard: cloud_init
: 1348396 (view as bug list)
Depends On:
Blocks: 1348989 1348990 1348991
TreeView+ depends on / blocked
 
Reported: 2016-06-21 15:02 UTC by Brandon Dunne
Modified: 2017-01-12 04:49 UTC (History)
7 users (show)

Fixed In Version: 5.7.0.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1348989 1348990 1348991 (view as bug list)
Environment:
Last Closed: 2017-01-11 19:49:20 UTC
Category: ---
Cloudforms Team: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Brandon Dunne 2016-06-21 15:02:55 UTC
Description of problem:
Due to API changes in RHEV 3.5.5+ we need to send use_cloud_init=true when starting the VM if we want user data (cloud-init) attached.  In BZ 1282618 we fixed the issue when using the out-of-box cloud-init provisioning with autostart.  However, there was still an issue if you are not using the "autostart_destination" feature, because a regular VM start would not set the use_cloud_init flag.

Based on changes in https://bugzilla.redhat.com/show_bug.cgi?id=1282618
Additional discussion in https://bugzilla.redhat.com/show_bug.cgi?id=1328439

How reproducible:
Always

Steps to Reproduce:
1. Provision a VM without setting the autostart destination
2. Start the VM through the UI

Actual results:
VM will not have cloud-init data attached

Expected results:
VM should have cloud-init data attached

Comment 3 CFME Bot 2016-06-21 16:16:07 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/d17f96468ee213076862890b67d46a2e5f46cdbf

commit d17f96468ee213076862890b67d46a2e5f46cdbf
Author:     Brandon Dunne <bdunne>
AuthorDate: Tue Jun 21 11:04:39 2016 -0400
Commit:     Brandon Dunne <bdunne>
CommitDate: Tue Jun 21 11:04:39 2016 -0400

    Move boot_with_cloudinit logic from provision to rhevm vm
    
    In some cases during a provision, the provisioner does not want to use the
    autostart destination logic of the provisioning state machine. Unfortunately
    for rhevm vms, we need to set use_cloud_init = true when booting for the
    cloud-init data to be attached. So we move this logic to the vm istelf by
    setting a custom attribute on the vm, then modifying the raw_start method
    to check for the custom attribute and conditionally set the flag and remove
    the custom attribute.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1348614

 .../providers/redhat/infra_manager/provision/state_machine.rb    | 9 ++-------
 .../providers/redhat/infra_manager/vm/operations/power.rb        | 6 +++++-
 .../redhat/infra_manager/provision/state_machine_spec.rb         | 3 ++-
 3 files changed, 9 insertions(+), 9 deletions(-)

Comment 7 CFME Bot 2016-06-22 13:53:56 UTC
New commit detected on cfme/5.5.z:
https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=7f8f9859c035e9dc272a3d3ba1c700796220e828

commit 7f8f9859c035e9dc272a3d3ba1c700796220e828
Merge: 2e38c82 5cdd576
Author:     Greg McCullough <gmccullo>
AuthorDate: Wed Jun 22 09:48:36 2016 -0400
Commit:     Greg McCullough <gmccullo>
CommitDate: Wed Jun 22 09:48:36 2016 -0400

    Merge branch '5.5.z.cloudinit_custom_attribute' into '5.5.z'
    
    Move boot_with_cloudinit logic from provision to rhevm vm
    
    In some cases during a provision, the provisioner does not want to use the
    autostart destination logic of the provisioning state machine. Unfortunately
    for rhevm vms, we need to set use_cloud_init = true when booting for the
    cloud-init data to be attached. So we move this logic to the vm istelf by
    setting a custom attribute on the vm, then modifying the raw_start method
    to check for the custom attribute and conditionally set the flag and remove
    the custom attribute.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1348614
    
    Spec conflicts resolved and require 'ovirt' added
    
    Upstream PR https://github.com/ManageIQ/manageiq/pull/9325
    
    See merge request !983

 .../providers/redhat/infra_manager/provision/state_machine.rb    | 9 ++-------
 .../providers/redhat/infra_manager/vm/operations/power.rb        | 8 +++++++-
 .../redhat/infra_manager/provision/state_machine_spec.rb         | 6 ++++--
 3 files changed, 13 insertions(+), 10 deletions(-)

Comment 8 CFME Bot 2016-06-22 13:53:59 UTC
New commit detected on cfme/5.5.z:
https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=5cdd576bcb9d5741f822cc032522298365a17ef5

commit 5cdd576bcb9d5741f822cc032522298365a17ef5
Author:     Brandon Dunne <bdunne>
AuthorDate: Tue Jun 21 13:07:24 2016 -0400
Commit:     Brandon Dunne <bdunne>
CommitDate: Tue Jun 21 13:07:24 2016 -0400

    Move boot_with_cloudinit logic from provision to rhevm vm
    
    In some cases during a provision, the provisioner does not want to use the
    autostart destination logic of the provisioning state machine. Unfortunately
    for rhevm vms, we need to set use_cloud_init = true when booting for the
    cloud-init data to be attached. So we move this logic to the vm istelf by
    setting a custom attribute on the vm, then modifying the raw_start method
    to check for the custom attribute and conditionally set the flag and remove
    the custom attribute.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1348614
    
    Spec conflicts resolved and require 'ovirt' added

 .../providers/redhat/infra_manager/provision/state_machine.rb    | 9 ++-------
 .../providers/redhat/infra_manager/vm/operations/power.rb        | 8 +++++++-
 .../redhat/infra_manager/provision/state_machine_spec.rb         | 6 ++++--
 3 files changed, 13 insertions(+), 10 deletions(-)

Comment 9 CFME Bot 2016-06-22 14:09:52 UTC
New commit detected on cfme/5.4.z:
https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=47a13bf18fbf5eb98bf29a39d6bb1a15245e1caa

commit 47a13bf18fbf5eb98bf29a39d6bb1a15245e1caa
Author:     Brandon Dunne <bdunne>
AuthorDate: Tue Jun 21 17:25:52 2016 -0400
Commit:     Brandon Dunne <bdunne>
CommitDate: Tue Jun 21 17:25:52 2016 -0400

    Backport: Move boot_with_cloudinit logic from provision to rhevm vm
    
    In some cases during a provision, the provisioner does not want to use the
    autostart destination logic of the provisioning state machine. Unfortunately
    for rhevm vms, we need to set use_cloud_init = true when booting for the
    cloud-init data to be attached. So we move this logic to the vm istelf by
    setting a custom attribute on the vm, then modifying the raw_start method
    to check for the custom attribute and conditionally set the flag and remove
    the custom attribute.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1348614
    
    Spec conflicts resolved and require 'ovirt' added
    Filenames are different

 vmdb/app/models/miq_provision_redhat/state_machine.rb       | 9 ++-------
 vmdb/app/models/vm_redhat/operations/power.rb               | 6 +++++-
 vmdb/spec/models/miq_provision_redhat/state_machine_spec.rb | 6 ++++--
 3 files changed, 11 insertions(+), 10 deletions(-)

Comment 10 CFME Bot 2016-06-22 14:09:55 UTC
New commit detected on cfme/5.4.z:
https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=167715a915155dc567f9d29fae5e261d3f58ce09

commit 167715a915155dc567f9d29fae5e261d3f58ce09
Merge: 5898001 47a13bf
Author:     Greg McCullough <gmccullo>
AuthorDate: Wed Jun 22 10:07:54 2016 -0400
Commit:     Greg McCullough <gmccullo>
CommitDate: Wed Jun 22 10:07:54 2016 -0400

    Merge branch '5.4.z.cloudinit_custom_attribute' into '5.4.z'
    
    Backport: Move boot_with_cloudinit logic from provision to rhevm vm
    
    In some cases during a provision, the provisioner does not want to use the
    autostart destination logic of the provisioning state machine. Unfortunately
    for rhevm vms, we need to set use_cloud_init = true when booting for the
    cloud-init data to be attached. So we move this logic to the vm istelf by
    setting a custom attribute on the vm, then modifying the raw_start method
    to check for the custom attribute and conditionally set the flag and remove
    the custom attribute.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1348614
    
    Spec conflicts resolved and require 'ovirt' added
    Filenames are different
    
    Upstream PR https://github.com/ManageIQ/manageiq/pull/9325
    
    See merge request !984

 vmdb/app/models/miq_provision_redhat/state_machine.rb       | 9 ++-------
 vmdb/app/models/vm_redhat/operations/power.rb               | 6 +++++-
 vmdb/spec/models/miq_provision_redhat/state_machine_spec.rb | 6 ++++--
 3 files changed, 11 insertions(+), 10 deletions(-)

Comment 11 Greg McCullough 2016-06-22 16:46:22 UTC
*** Bug 1348396 has been marked as a duplicate of this bug. ***

Comment 14 luke couzens 2016-09-16 13:19:55 UTC
Verified in 5.7.0.0


Note You need to log in before you can comment on or make changes to this bug.