Bug 1169624 - Issues with vm start up through API
Summary: Issues with vm start up through API
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: oVirt
Classification: Retired
Component: ovirt-engine-api
Version: 3.5
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: ---
: ---
Assignee: Juan Hernández
QA Contact: Pavel Stehlik
URL:
Whiteboard: virt
: 1169625 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-12-02 04:54 UTC by punit
Modified: 2014-12-02 14:36 UTC (History)
9 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2014-12-02 14:36:27 UTC
oVirt Team: ---
Embargoed:


Attachments (Terms of Use)
VM failed (32.32 KB, image/png)
2014-12-02 04:54 UTC, punit
no flags Details

Description punit 2014-12-02 04:54:21 UTC
Created attachment 963532 [details]
VM failed

Description of problem:I am using the ovirt version 3.5 and having some issues with the vm startup with cloud-init using api in run-once mode.....


Version-Release number of selected component (if applicable):
Engine 3.5 (On centos 6.6)
Host On Centos 7.


How reproducible:


Steps to Reproduce:
1. Create the VM by API from precreated OS Template..(Template has boot order priority 1. harddisk 2. Cdrom) 
2. Start the VM in run-once mode and push the cloud-init data from API.. 
3. VM stuck and from console it display the following :- 
Booting from DVD/CD.. ... 
Boot failed : could not read from CDROM (code 004) 

Actual results:Can not Startup the VM..


Expected results: VM will startup and get the cloud-init data from API..


Additional info:I am using the following XML for the API propose...

I am using the following xml for this operation :-

<action>
    <vm>
     <os>
      <boot dev='cdrom'/>    
     </os>
     <initialization>
      <cloud_init>
       <host>
        <address>test</address>
       </host>
       <network_configuration>
        <nics>
         <nic>
          <interface>virtIO</interface> 
          <name>eth0</name>
          <boot_protocol>static</boot_protocol>
          <mac address=''/>
          <network>
           <ip address='' netmask='' gateway=''/>
          </network>
          <on_boot>true</on_boot><vnic_profile id='' />
         </nic>
         <nic>
          <interface>virtIO</interface> 
          <name>eth1</name>
          <boot_protocol>static</boot_protocol>
          <mac address=''/>
          <network>
           <ip address='' netmask='255.255.255.0' gateway=''/>
          </network>
          <on_boot>true</on_boot><vnic_profile id='' />
         </nic>
        </nics>
       </network_configuration>
       <files>
        <file>
         <name>/ignored</name><content><![CDATA[#cloud-config
disable-ec2-metadata: true
disable_root: false
ssh_pwauth: true
ssh_deletekeys: true
chpasswd: { expire: False }

users:
 - name: root
   primary-group: root
   passwd: 8W7RQ5Bh
   lock-passwd: false

runcmd:
 - sed -i '/nameserver/d' /etc/resolv.conf
 - echo 'nameserver 8.8.8.8' >> /etc/resolv.conf
 - echo 'nameserver 8.8.4.4' >> /etc/resolv.conf
 - echo 'root:8W7RQ5Bh' | chpasswd
 - yum -y update
 - yum -y install rdate
 - rdate -s stdtime.gov.hk]]></content>
         <type>plaintext</type>
        </file>
       </files>
      </cloud_init><custom_script><![CDATA[#cloud-config
disable-ec2-metadata: true
disable_root: false
ssh_pwauth: true
ssh_deletekeys: true
chpasswd: { expire: False }

users:
 - name: root
   primary-group: root
   passwd: 8W7RQ5Bh
   lock-passwd: false

runcmd:
 - sed -i '/nameserver/d' /etc/resolv.conf
 - echo 'nameserver 8.8.8.8' >> /etc/resolv.conf
 - echo 'nameserver 8.8.4.4' >> /etc/resolv.conf
 - echo 'root:8W7RQ5Bh' | chpasswd
 - yum -y update
 - yum -y install rdate
 - rdate -s stdtime.gov.hk]]></custom_script>
     </initialization>
    </vm>
   </action>

Comment 1 Omer Frenkel 2014-12-02 07:38:04 UTC
for some reason i missed that you are using run once,
and in this run once, you override the boot order with cd-rom only:
 <os>
   <boot dev='cdrom'/>    
 </os>

this is not needed when you start the vm,
because we still want the vm to boot from hard-disk,
the cloud init cd rom will be used by the cloud-init service when the vm starts.
please try again without changing the boot and see if it helps

Comment 2 punit 2014-12-02 10:02:38 UTC
Hi Omer,

We try the same method in the previous cluster and it's working fine there....the only difference between both the cluster is the host OS version :- 

1. New One Built on CentOS 7
2. Old One Built On CentOS 6.6

Yes...it's true if we remove this part from the XML the VM can boot up...

<os>
   <boot dev='cdrom'/>    
 </os>

But earlier someone from community suggested us to use this method to put the cloud-init data...

Thanks,
Punit

Comment 3 Gil Klein 2014-12-02 12:41:45 UTC
*** Bug 1169625 has been marked as a duplicate of this bug. ***

Comment 4 Omer Frenkel 2014-12-02 14:36:27 UTC
Thanks Punit for the update,
i guess the suggestion was just wrong.. there is no relation between cloud-init and boot order.

since its working, closing.
please re-open if needed


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