Bug 983671

Summary: RHEVM-BACKEND: stop vm doesn't work from API
Product: Red Hat Enterprise Virtualization Manager Reporter: Barak Dagan <bdagan>
Component: ovirt-engineAssignee: Martin Betak <mbetak>
Status: CLOSED DUPLICATE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 3.3.0CC: acathrow, iheim, jkt, lpeer, michal.skrivanek, obasan, ofrenkel, pstehlik, Rhev-m-bugs, yeylon
Target Milestone: ---Keywords: Regression, TestBlocker, Triaged
Target Release: 3.3.0Flags: acathrow: Triaged+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: virt
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-07-17 09:31:36 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Automation logs
none
vdsms + engine logs, local env none

Description Barak Dagan 2013-07-11 16:44:10 UTC
Created attachment 772311 [details]
Automation logs

Description of problem:

1st stop of VM using API (rest / cli) results an error - 


2013-07-11 15:39:36,089 INFO  [org.ovirt.engine.core.bll.StopVmCommand] (ajp-/127.0.0.1:8702-7) Running command: StopVmCommand internal: false. Entities affected :  ID: 88b798be-3c8b-4ec5-ae53-0a602e0c9014 Type: VM
2013-07-11 15:39:36,099 INFO  [org.ovirt.engine.core.vdsbroker.DestroyVmVDSCommand] (ajp-/127.0.0.1:8702-7) START, DestroyVmVDSCommand(HostName = 10.35.160.63, HostId = b00d4573-ad90-4536-b4a5-cd9cf4608197, vmId=88b798be-3c8b-4ec5-ae53-0a602e0c9014, force=false, secondsToWait=0, gracefully=false), log id: 1935484e
2013-07-11 15:39:36,115 ERROR [org.ovirt.engine.core.vdsbroker.DestroyVmVDSCommand] (ajp-/127.0.0.1:8702-7) Command DestroyVmVDS execution failed. Exception: EJBException: java.lang.NullPointerException


2nd stop - works

Version-Release number of selected component (if applicable):
is4-5

How reproducible:
100%

Steps to Reproduce:
1. create vm + network + disk
2. start vm from api
3. stop vm from api


[RHEVM shell (connected)]# add vm --name vm1 --cluster-name CL1 --template-name Blank

id                        : 9e096f47-1a49-4188-b628-791274a2737d
name                      : vm1
cluster-id                : ba35802c-462e-4b43-a6e8-1823e7575eb8
cpu-topology-cores        : 1
cpu-topology-sockets      : 1
creation_time             : 2013-07-11 18:48:46.884000+03:00
delete_protected          : False
display-allow_override    : False
display-monitors          : 1
display-smartcard_enabled : False
display-type              : spice
high_availability-enabled : False
high_availability-priority: 0
memory                    : 1073741824
memory_policy-ballooning  : True
memory_policy-guaranteed  : 1073741824
origin                    : ovirt
os-boot-dev               : hd
os-type                   : unassigned
placement_policy-affinity : migratable
quota-id                  : 00000000-0000-0000-0000-000000000000
stateless                 : False
status-state              : down
template-id               : 00000000-0000-0000-0000-000000000000
type                      : desktop
usb-enabled               : False



[RHEVM shell (connected)]# add nic --name nic1 --vm-identifier vm1 --network-name rhevm

id         : b6318ad0-7058-4e45-8c6d-efd9b71f752a
name       : nic1
active     : True
interface  : virtio
linked     : True
mac-address: 00:1a:4a:23:a1:1f
plugged    : True
vm-id      : 9e096f47-1a49-4188-b628-791274a2737d

add disk ...

[RHEVM shell (connected)]# action vm vm1 start

status-state: complete
vm-id       : 9e096f47-1a49-4188-b628-791274a2737d

[RHEVM shell (connected)]# show vm vm1 | grep status
status-state              : powering_up
[RHEVM shell (connected)]# action vm vm1 stop


error: 
status: 400
reason: Bad Request
detail: engine


[RHEVM shell (connected)]# action vm vm1 stop

status-state: complete
vm-id       : 9e096f47-1a49-4188-b628-791274a2737d

[RHEVM shell (connected)]# 



Actual results:

error: 
status: 400
reason: Bad Request
detail: engine

Expected results:
that vm will stop

Additional info:

Comment 1 Barak Dagan 2013-07-11 16:48:25 UTC
Created attachment 772312 [details]
vdsms + engine logs, local env

Comment 3 Omer Frenkel 2013-07-17 09:31:36 UTC
Verified with Barak Dagan this is the same error as in bug 974999
so closing as dup

*** This bug has been marked as a duplicate of bug 974999 ***