Re: [Users] Unable to get latest resource status

2012-04-27 Thread Alex Jia

On 04/27/2012 11:30 PM, Juan Hernandez wrote:

On 04/27/2012 05:27 PM, Alex Jia wrote:

Although I haven't try it, I think you're right, I should refresh VM
in loop body.

Let me know what is the result in your environment.

I have tried it and indeed works well for me.

In addition, as I said, it will be convenient if we have wait_for_status
function like before.

I will look into it. I would greatly appreciate if you can open a bug to
request and track it.

It's okay for me, I want to know I need to file a fedora bug? which 
component?

because I'm doing these on RHEL6.2.

- Original Message -
From: "Juan Hernandez"
To: "Alex Jia"
Cc: users@ovirt.org, "Rita Wu"
Sent: Friday, April 27, 2012 8:17:05 PM
Subject: Re: [Users] Unable to get latest resource status

On 04/27/2012 12:06 PM, Alex Jia wrote:

On 04/27/2012 04:06 PM, Juan Hernandez wrote:

On 04/26/2012 05:49 PM, Alex Jia wrote:

I built ovirt-engine-sdk rpm based on git repo 
'http://gerrit.ovirt.org/p/ovirt-engine-sdk.git',
then the ovirt-engine-sdk works well for me, I can get resource information 
from Ovirt/RHEVM(3.0)
on the rhel6.2.

The only question is I can't get latest resource status when I changed VM from 
'suspended' to 'up'
status, the api.vms.get(vm_name).status.state is always 'suspended' status, I 
can get a correct
VM status unless I reconnect Ovirt/RHEVM, it's not convenient for users, I 
remember there are reload
and wait_for_status method in old python binding API of RHEV(python-rhev), the 
wait_for_status method
will reload resource then get current resource status, however, I haven't found 
similar method in
ovirt-engine-sdk.

Are you sure you are calling api.vms.get(vm_name) each time? Or are you
doing something like this:

vm = api.vms.get(vm_name)
while vm.status.state == "suspended":
  sleep(10)

Yeah, I put 'api.vms.get(vm_name)' in a loop body like above codes.

If you are doing that the vm information is retrieved only once, not
each time. If this is the case try something like this:

while api.vms.get(VM_NAME).status.state == "suspended":
  sleep(1)

Can you share that snippet of code so that I can try to reproduce it?

Okay, I will list my snippet of code in here, you may replace 'logging'
with 'print' then remove
useless '()' if need. thanks.



import time, logging
from ovirtsdk.api import API
from ovirtsdk.xml import params

class RHEV(object):
  """
  RHEV class
  """

  def __init__(self, url, username, password):
  try:
  self.api = API(url, username, password)
  except Exception as e:
  logging.error('could not connect: %s\n' % str(e))
  else:
  logging.info('success: RHEV manager could be reached OK\n')

  def vm_start(self, vm_name):
  try:
  vm = self.api.vms.get(vm_name)
  if vm.status.state != 'up':
  logging.info('Starting VM')
  vm.start()
  logging.info('Waiting for VM to reach Up status')
  while vm.status.state != 'up':

I think that the problem is with the line above. The VM object that you
get with "self.api.vms.get(vm_name)" is not automatically refreshed, you
have to refresh it before each iteration calling the "api.vms.get(...)"
method again:

   while api.vms.get(vm_name).status.state != 'up':

Can you try that?


  time.sleep(1)
  else:
  logging.debug('VM already up')
  except Exception as e:
  logging.error('Failed to start VM:\n%s' % str(e))

  def vm_suspend(self, vm_name):
  vm = self.api.vms.get(vm_name)
  while vm.status.state != 'suspended':
  try:
  logging.info('Suspend VM')
  vm.suspend()
  logging.info('Waiting for VM to reach suspended status')
  while vm.status.state != 'suspended':

Same here ^.


  time.sleep(1)

  except Exception as e:
  if e.reason == 'Bad Request' \
  and 'asynchronous running tasks' in e.detail:
  logging.warning('VM has asynchronous running tasks,
trying again')
  time.sleep(1)
  else:
  logging.error('Failed to suspend VM:\n%s' % str(e))
  break

  def vm_resume(self, vm_name):
  try:
  vm = self.api.vms.get(vm_name)
  if vm.status.state != 'up':
  logging.info('Resume VM')
  vm.start()
  logging.info('Waiting for VM to resume')
  while vm.status.state != 'up':

Same here ^.


  time.sleep(1)
  else:
  logging.debug('VM already up')
  except Exception as e:
  logging.error('Failed to resume VM:\n%s' % str(e))





___
Users mailing list

Re: [Users] error when regestering a host with vdsm 4.9.6 in ovirt 3.1

2012-04-27 Thread Douglas Landgraf

Hi,

On 04/27/2012 08:44 AM, Nathanaël Blanchet wrote:
here they are, there is a lot of log files, because I tried a lot of 
time :)


Le 27/04/2012 15:16, Douglas Landgraf a écrit :

Hi,

On 04/26/2012 11:37 AM, Nathanaël Blanchet wrote:
I have built and installed the latest RPM ovirt-engine from the 
source on F16 and the latest RPM VDSM 4.9.6 on F17 because of nedeed 
dependancies.

when I add a new host, installation always fails with this issue :
Failed to install Host khamsin. Step: CreateConf; Details: Basic 
configuration failed to import default values.


I tried to disable ssl in engine and vdsm but it is the same.

I have searched more explications into vdsm and ovirt log but I have 
found anything
I suppose vdsm to be the problem, the only way to build it with 
success is to install it on F17, which is a beta release...


This makes me crazy!
May anybody  help me to find a clue for this issue?


on Node side, can you please share /tmp/vds_* logs?
rpm -qa | grep vdsm  (from oVirt Node and oVirt engine)



As we resolved this case by irc, here the reply to mailing list:

=

The error from logs:

Fri, 27 Apr 2012 14:55:24 DEBUG status='OK' result='libjpeg' message='le paquetage libjpeg n~est pas 
installé '/>

Fri, 27 Apr 2012 14:55:24 ERROR
Traceback (most recent call last):
File "/tmp/vds_bootstrap_9e3dc61c-4ef8-4c42-873c-6209c522ac4c.py", line 
594, in createConf

self._makeConfig()
File "/tmp/vds_bootstrap_9e3dc61c-4ef8-4c42-873c-6209c522ac4c.py", line 
557, in _makeConfig

from config import config
ImportError: No module named config
Fri, 27 Apr 2012 14:55:24 DEBUG status='FAIL' message='Basic configuration failed to import default 
values'/>

Fri, 27 Apr 2012 14:55:24 ERRORcreateConf failed
Fri, 27 Apr 2012 14:55:24 DEBUG status='FAIL'/>

Fri, 27 Apr 2012 14:55:24 DEBUG End VDS Validation 


=

On Engine side Nathanaël's machine had: vds_bootstrap version 
(vdsm-bootstrap-4.9.3.2-0.fc16.noarch) which had to update to a newer 
version: 4.9.6
copied new vds_bootstrap files from: /usr/share/vds_bootstrap to 
/usr/share/ovirt-engine/engine.ear/components.war/vds

and removed any *.pyc and *.pyo from there.

On Node side:

rm -f /tmp/deploy* (remove old deployUtil)
rm -f /tmp/vds* (remove old log files)





--
Cheers
Douglas

___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users


[Users] Cannot run VM

2012-04-27 Thread David Metcalf
The error is, "Cannot run VM.  There are no available running Hosts with 
sufficient memory in VM's Cluster."


What is the requirement and how can it be adjusted?
___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users


Re: [Users] Unable to get latest resource status

2012-04-27 Thread Juan Hernandez
On 04/27/2012 05:27 PM, Alex Jia wrote:
> Although I haven't try it, I think you're right, I should refresh VM
> in loop body.

Let me know what is the result in your environment.

> In addition, as I said, it will be convenient if we have wait_for_status 
> function like before.

I will look into it. I would greatly appreciate if you can open a bug to
request and track it.

> - Original Message -
> From: "Juan Hernandez" 
> To: "Alex Jia" 
> Cc: users@ovirt.org, "Rita Wu" 
> Sent: Friday, April 27, 2012 8:17:05 PM
> Subject: Re: [Users] Unable to get latest resource status
> 
> On 04/27/2012 12:06 PM, Alex Jia wrote:
>> On 04/27/2012 04:06 PM, Juan Hernandez wrote:
>>> On 04/26/2012 05:49 PM, Alex Jia wrote:
 I built ovirt-engine-sdk rpm based on git repo 
 'http://gerrit.ovirt.org/p/ovirt-engine-sdk.git',
 then the ovirt-engine-sdk works well for me, I can get resource 
 information from Ovirt/RHEVM(3.0)
 on the rhel6.2.

 The only question is I can't get latest resource status when I changed VM 
 from 'suspended' to 'up'
 status, the api.vms.get(vm_name).status.state is always 'suspended' 
 status, I can get a correct
 VM status unless I reconnect Ovirt/RHEVM, it's not convenient for users, I 
 remember there are reload
 and wait_for_status method in old python binding API of RHEV(python-rhev), 
 the wait_for_status method
 will reload resource then get current resource status, however, I haven't 
 found similar method in
 ovirt-engine-sdk.
>>> Are you sure you are calling api.vms.get(vm_name) each time? Or are you
>>> doing something like this:
>>>
>>> vm = api.vms.get(vm_name)
>>> while vm.status.state == "suspended":
>>>  sleep(10)
>> Yeah, I put 'api.vms.get(vm_name)' in a loop body like above codes.
>>> If you are doing that the vm information is retrieved only once, not
>>> each time. If this is the case try something like this:
>>>
>>> while api.vms.get(VM_NAME).status.state == "suspended":
>>>  sleep(1)
>>>
>>> Can you share that snippet of code so that I can try to reproduce it?
>> Okay, I will list my snippet of code in here, you may replace 'logging' 
>> with 'print' then remove
>> useless '()' if need. thanks.
>>
>>
>> 
>> import time, logging
>> from ovirtsdk.api import API
>> from ovirtsdk.xml import params
>>
>> class RHEV(object):
>>  """
>>  RHEV class
>>  """
>>
>>  def __init__(self, url, username, password):
>>  try:
>>  self.api = API(url, username, password)
>>  except Exception as e:
>>  logging.error('could not connect: %s\n' % str(e))
>>  else:
>>  logging.info('success: RHEV manager could be reached OK\n')
>>
>>  def vm_start(self, vm_name):
>>  try:
>>  vm = self.api.vms.get(vm_name)
>>  if vm.status.state != 'up':
>>  logging.info('Starting VM')
>>  vm.start()
>>  logging.info('Waiting for VM to reach Up status')
>>  while vm.status.state != 'up':
> 
> I think that the problem is with the line above. The VM object that you
> get with "self.api.vms.get(vm_name)" is not automatically refreshed, you
> have to refresh it before each iteration calling the "api.vms.get(...)"
> method again:
> 
>   while api.vms.get(vm_name).status.state != 'up':
> 
> Can you try that?
> 
>>  time.sleep(1)
>>  else:
>>  logging.debug('VM already up')
>>  except Exception as e:
>>  logging.error('Failed to start VM:\n%s' % str(e))
>>
>>  def vm_suspend(self, vm_name):
>>  vm = self.api.vms.get(vm_name)
>>  while vm.status.state != 'suspended':
>>  try:
>>  logging.info('Suspend VM')
>>  vm.suspend()
>>  logging.info('Waiting for VM to reach suspended status')
>>  while vm.status.state != 'suspended':
> 
> Same here ^.
> 
>>  time.sleep(1)
>>
>>  except Exception as e:
>>  if e.reason == 'Bad Request' \
>>  and 'asynchronous running tasks' in e.detail:
>>  logging.warning('VM has asynchronous running tasks, 
>> trying again')
>>  time.sleep(1)
>>  else:
>>  logging.error('Failed to suspend VM:\n%s' % str(e))
>>  break
>>
>>  def vm_resume(self, vm_name):
>>  try:
>>  vm = self.api.vms.get(vm_name)
>>  if vm.status.state != 'up':
>>  logging.info('Resume VM')
>>  vm.start()
>>  logging.info('Waiting for VM to resume')
>>  while vm.status.state != 'up':
> 
> Same here ^.
> 
>>  time.sleep(1)
>>  else:
>>  logging.debug('VM already up')
>>  except Exception as e:
>> 

Re: [Users] Unable to get latest resource status

2012-04-27 Thread Alex Jia
Hi Juan,
Although I haven't try it, I think you're right, I should refresh VM
in loop body. 

In addition, as I said, it will be convenient if we have wait_for_status 
function like before.

Thanks,
Alex 


- Original Message -
From: "Juan Hernandez" 
To: "Alex Jia" 
Cc: users@ovirt.org, "Rita Wu" 
Sent: Friday, April 27, 2012 8:17:05 PM
Subject: Re: [Users] Unable to get latest resource status

On 04/27/2012 12:06 PM, Alex Jia wrote:
> On 04/27/2012 04:06 PM, Juan Hernandez wrote:
>> On 04/26/2012 05:49 PM, Alex Jia wrote:
>>> I built ovirt-engine-sdk rpm based on git repo 
>>> 'http://gerrit.ovirt.org/p/ovirt-engine-sdk.git',
>>> then the ovirt-engine-sdk works well for me, I can get resource information 
>>> from Ovirt/RHEVM(3.0)
>>> on the rhel6.2.
>>>
>>> The only question is I can't get latest resource status when I changed VM 
>>> from 'suspended' to 'up'
>>> status, the api.vms.get(vm_name).status.state is always 'suspended' status, 
>>> I can get a correct
>>> VM status unless I reconnect Ovirt/RHEVM, it's not convenient for users, I 
>>> remember there are reload
>>> and wait_for_status method in old python binding API of RHEV(python-rhev), 
>>> the wait_for_status method
>>> will reload resource then get current resource status, however, I haven't 
>>> found similar method in
>>> ovirt-engine-sdk.
>> Are you sure you are calling api.vms.get(vm_name) each time? Or are you
>> doing something like this:
>>
>> vm = api.vms.get(vm_name)
>> while vm.status.state == "suspended":
>>  sleep(10)
> Yeah, I put 'api.vms.get(vm_name)' in a loop body like above codes.
>> If you are doing that the vm information is retrieved only once, not
>> each time. If this is the case try something like this:
>>
>> while api.vms.get(VM_NAME).status.state == "suspended":
>>  sleep(1)
>>
>> Can you share that snippet of code so that I can try to reproduce it?
> Okay, I will list my snippet of code in here, you may replace 'logging' 
> with 'print' then remove
> useless '()' if need. thanks.
> 
> 
> 
> import time, logging
> from ovirtsdk.api import API
> from ovirtsdk.xml import params
> 
> class RHEV(object):
>  """
>  RHEV class
>  """
> 
>  def __init__(self, url, username, password):
>  try:
>  self.api = API(url, username, password)
>  except Exception as e:
>  logging.error('could not connect: %s\n' % str(e))
>  else:
>  logging.info('success: RHEV manager could be reached OK\n')
> 
>  def vm_start(self, vm_name):
>  try:
>  vm = self.api.vms.get(vm_name)
>  if vm.status.state != 'up':
>  logging.info('Starting VM')
>  vm.start()
>  logging.info('Waiting for VM to reach Up status')
>  while vm.status.state != 'up':

I think that the problem is with the line above. The VM object that you
get with "self.api.vms.get(vm_name)" is not automatically refreshed, you
have to refresh it before each iteration calling the "api.vms.get(...)"
method again:

  while api.vms.get(vm_name).status.state != 'up':

Can you try that?

>  time.sleep(1)
>  else:
>  logging.debug('VM already up')
>  except Exception as e:
>  logging.error('Failed to start VM:\n%s' % str(e))
> 
>  def vm_suspend(self, vm_name):
>  vm = self.api.vms.get(vm_name)
>  while vm.status.state != 'suspended':
>  try:
>  logging.info('Suspend VM')
>  vm.suspend()
>  logging.info('Waiting for VM to reach suspended status')
>  while vm.status.state != 'suspended':

Same here ^.

>  time.sleep(1)
> 
>  except Exception as e:
>  if e.reason == 'Bad Request' \
>  and 'asynchronous running tasks' in e.detail:
>  logging.warning('VM has asynchronous running tasks, 
> trying again')
>  time.sleep(1)
>  else:
>  logging.error('Failed to suspend VM:\n%s' % str(e))
>  break
> 
>  def vm_resume(self, vm_name):
>  try:
>  vm = self.api.vms.get(vm_name)
>  if vm.status.state != 'up':
>  logging.info('Resume VM')
>  vm.start()
>  logging.info('Waiting for VM to resume')
>  while vm.status.state != 'up':

Same here ^.

>  time.sleep(1)
>  else:
>  logging.debug('VM already up')
>  except Exception as e:
>  logging.error('Failed to resume VM:\n%s' % str(e))
> 
> 
> 

___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users


Re: [Users] Unable to get latest resource status

2012-04-27 Thread Juan Hernandez
On 04/27/2012 12:06 PM, Alex Jia wrote:
> On 04/27/2012 04:06 PM, Juan Hernandez wrote:
>> On 04/26/2012 05:49 PM, Alex Jia wrote:
>>> I built ovirt-engine-sdk rpm based on git repo 
>>> 'http://gerrit.ovirt.org/p/ovirt-engine-sdk.git',
>>> then the ovirt-engine-sdk works well for me, I can get resource information 
>>> from Ovirt/RHEVM(3.0)
>>> on the rhel6.2.
>>>
>>> The only question is I can't get latest resource status when I changed VM 
>>> from 'suspended' to 'up'
>>> status, the api.vms.get(vm_name).status.state is always 'suspended' status, 
>>> I can get a correct
>>> VM status unless I reconnect Ovirt/RHEVM, it's not convenient for users, I 
>>> remember there are reload
>>> and wait_for_status method in old python binding API of RHEV(python-rhev), 
>>> the wait_for_status method
>>> will reload resource then get current resource status, however, I haven't 
>>> found similar method in
>>> ovirt-engine-sdk.
>> Are you sure you are calling api.vms.get(vm_name) each time? Or are you
>> doing something like this:
>>
>> vm = api.vms.get(vm_name)
>> while vm.status.state == "suspended":
>>  sleep(10)
> Yeah, I put 'api.vms.get(vm_name)' in a loop body like above codes.
>> If you are doing that the vm information is retrieved only once, not
>> each time. If this is the case try something like this:
>>
>> while api.vms.get(VM_NAME).status.state == "suspended":
>>  sleep(1)
>>
>> Can you share that snippet of code so that I can try to reproduce it?
> Okay, I will list my snippet of code in here, you may replace 'logging' 
> with 'print' then remove
> useless '()' if need. thanks.
> 
> 
> 
> import time, logging
> from ovirtsdk.api import API
> from ovirtsdk.xml import params
> 
> class RHEV(object):
>  """
>  RHEV class
>  """
> 
>  def __init__(self, url, username, password):
>  try:
>  self.api = API(url, username, password)
>  except Exception as e:
>  logging.error('could not connect: %s\n' % str(e))
>  else:
>  logging.info('success: RHEV manager could be reached OK\n')
> 
>  def vm_start(self, vm_name):
>  try:
>  vm = self.api.vms.get(vm_name)
>  if vm.status.state != 'up':
>  logging.info('Starting VM')
>  vm.start()
>  logging.info('Waiting for VM to reach Up status')
>  while vm.status.state != 'up':

I think that the problem is with the line above. The VM object that you
get with "self.api.vms.get(vm_name)" is not automatically refreshed, you
have to refresh it before each iteration calling the "api.vms.get(...)"
method again:

  while api.vms.get(vm_name).status.state != 'up':

Can you try that?

>  time.sleep(1)
>  else:
>  logging.debug('VM already up')
>  except Exception as e:
>  logging.error('Failed to start VM:\n%s' % str(e))
> 
>  def vm_suspend(self, vm_name):
>  vm = self.api.vms.get(vm_name)
>  while vm.status.state != 'suspended':
>  try:
>  logging.info('Suspend VM')
>  vm.suspend()
>  logging.info('Waiting for VM to reach suspended status')
>  while vm.status.state != 'suspended':

Same here ^.

>  time.sleep(1)
> 
>  except Exception as e:
>  if e.reason == 'Bad Request' \
>  and 'asynchronous running tasks' in e.detail:
>  logging.warning('VM has asynchronous running tasks, 
> trying again')
>  time.sleep(1)
>  else:
>  logging.error('Failed to suspend VM:\n%s' % str(e))
>  break
> 
>  def vm_resume(self, vm_name):
>  try:
>  vm = self.api.vms.get(vm_name)
>  if vm.status.state != 'up':
>  logging.info('Resume VM')
>  vm.start()
>  logging.info('Waiting for VM to resume')
>  while vm.status.state != 'up':

Same here ^.

>  time.sleep(1)
>  else:
>  logging.debug('VM already up')
>  except Exception as e:
>  logging.error('Failed to resume VM:\n%s' % str(e))
> 
> 
> 

___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users


Re: [Users] error when regestering a host with vdsm 4.9.6 in ovirt 3.1

2012-04-27 Thread Douglas Landgraf

Hi,

On 04/26/2012 11:37 AM, Nathanaël Blanchet wrote:
I have built and installed the latest RPM ovirt-engine from the source 
on F16 and the latest RPM VDSM 4.9.6 on F17 because of nedeed 
dependancies.

when I add a new host, installation always fails with this issue :
Failed to install Host khamsin. Step: CreateConf; Details: Basic 
configuration failed to import default values.


I tried to disable ssl in engine and vdsm but it is the same.

I have searched more explications into vdsm and ovirt log but I have 
found anything
I suppose vdsm to be the problem, the only way to build it with 
success is to install it on F17, which is a beta release...


This makes me crazy!
May anybody  help me to find a clue for this issue?


on Node side, can you please share /tmp/vds_* logs?
rpm -qa | grep vdsm  (from oVirt Node and oVirt engine)


Thanks!


--
Cheers
Douglas

___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users


Re: [Users] Unable to get latest resource status

2012-04-27 Thread Alex Jia

On 04/27/2012 04:06 PM, Juan Hernandez wrote:

On 04/26/2012 05:49 PM, Alex Jia wrote:

I built ovirt-engine-sdk rpm based on git repo 
'http://gerrit.ovirt.org/p/ovirt-engine-sdk.git',
then the ovirt-engine-sdk works well for me, I can get resource information 
from Ovirt/RHEVM(3.0)
on the rhel6.2.

The only question is I can't get latest resource status when I changed VM from 
'suspended' to 'up'
status, the api.vms.get(vm_name).status.state is always 'suspended' status, I 
can get a correct
VM status unless I reconnect Ovirt/RHEVM, it's not convenient for users, I 
remember there are reload
and wait_for_status method in old python binding API of RHEV(python-rhev), the 
wait_for_status method
will reload resource then get current resource status, however, I haven't found 
similar method in
ovirt-engine-sdk.

Are you sure you are calling api.vms.get(vm_name) each time? Or are you
doing something like this:

vm = api.vms.get(vm_name)
while vm.status.state == "suspended":
 sleep(10)

Yeah, I put 'api.vms.get(vm_name)' in a loop body like above codes.

If you are doing that the vm information is retrieved only once, not
each time. If this is the case try something like this:

while api.vms.get(VM_NAME).status.state == "suspended":
 sleep(1)

Can you share that snippet of code so that I can try to reproduce it?
Okay, I will list my snippet of code in here, you may replace 'logging' 
with 'print' then remove

useless '()' if need. thanks.



import time, logging
from ovirtsdk.api import API
from ovirtsdk.xml import params

class RHEV(object):
"""
RHEV class
"""

def __init__(self, url, username, password):
try:
self.api = API(url, username, password)
except Exception as e:
logging.error('could not connect: %s\n' % str(e))
else:
logging.info('success: RHEV manager could be reached OK\n')

def vm_start(self, vm_name):
try:
vm = self.api.vms.get(vm_name)
if vm.status.state != 'up':
logging.info('Starting VM')
vm.start()
logging.info('Waiting for VM to reach Up status')
while vm.status.state != 'up':
time.sleep(1)
else:
logging.debug('VM already up')
except Exception as e:
logging.error('Failed to start VM:\n%s' % str(e))

def vm_suspend(self, vm_name):
vm = self.api.vms.get(vm_name)
while vm.status.state != 'suspended':
try:
logging.info('Suspend VM')
vm.suspend()
logging.info('Waiting for VM to reach suspended status')
while vm.status.state != 'suspended':
time.sleep(1)

except Exception as e:
if e.reason == 'Bad Request' \
and 'asynchronous running tasks' in e.detail:
logging.warning('VM has asynchronous running tasks, 
trying again')

time.sleep(1)
else:
logging.error('Failed to suspend VM:\n%s' % str(e))
break

def vm_resume(self, vm_name):
try:
vm = self.api.vms.get(vm_name)
if vm.status.state != 'up':
logging.info('Resume VM')
vm.start()
logging.info('Waiting for VM to resume')
while vm.status.state != 'up':
time.sleep(1)
else:
logging.debug('VM already up')
except Exception as e:
logging.error('Failed to resume VM:\n%s' % str(e))



___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users


Re: [Users] Unable to get latest resource status

2012-04-27 Thread Juan Hernandez
On 04/26/2012 05:49 PM, Alex Jia wrote:
> I built ovirt-engine-sdk rpm based on git repo 
> 'http://gerrit.ovirt.org/p/ovirt-engine-sdk.git',
> then the ovirt-engine-sdk works well for me, I can get resource information 
> from Ovirt/RHEVM(3.0)
> on the rhel6.2.
> 
> The only question is I can't get latest resource status when I changed VM 
> from 'suspended' to 'up'
> status, the api.vms.get(vm_name).status.state is always 'suspended' status, I 
> can get a correct
> VM status unless I reconnect Ovirt/RHEVM, it's not convenient for users, I 
> remember there are reload 
> and wait_for_status method in old python binding API of RHEV(python-rhev), 
> the wait_for_status method 
> will reload resource then get current resource status, however, I haven't 
> found similar method in 
> ovirt-engine-sdk.

Are you sure you are calling api.vms.get(vm_name) each time? Or are you
doing something like this:

vm = api.vms.get(vm_name)
while vm.status.state == "suspended":
sleep(10)

If you are doing that the vm information is retrieved only once, not
each time. If this is the case try something like this:

while api.vms.get(VM_NAME).status.state == "suspended":
sleep(1)

Can you share that snippet of code so that I can try to reproduce it?
___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users


Re: [Users] Unable to get latest resource status

2012-04-27 Thread Juan Hernandez
On 04/26/2012 05:49 PM, Alex Jia wrote:
> I built ovirt-engine-sdk rpm based on git repo 
> 'http://gerrit.ovirt.org/p/ovirt-engine-sdk.git',
> then the ovirt-engine-sdk works well for me, I can get resource information 
> from Ovirt/RHEVM(3.0)
> on the rhel6.2.
> 
> The only question is I can't get latest resource status when I changed VM 
> from 'suspended' to 'up'
> status, the api.vms.get(vm_name).status.state is always 'suspended' status, I 
> can get a correct
> VM status unless I reconnect Ovirt/RHEVM, it's not convenient for users, I 
> remember there are reload 
> and wait_for_status method in old python binding API of RHEV(python-rhev), 
> the wait_for_status method 
> will reload resource then get current resource status, however, I haven't 
> found similar method in 
> ovirt-engine-sdk.

Are you sure you are calling api.vms.get(vm_name) each time? Or are you
doing something like this:

vm = api.vms.get(vm_name)
while vm.status.state == "suspended":
sleep(10)

If you are doing that the vm information is retrieved only once, not
each time. If this is the case try something like this:

while api.vms.get(VM_NAME).status.state == "suspended":
sleep(1)

Can you share that snippet of code so that I can try to reproduce it?

-- 
Dirección Comercial: C/Jose Bardasano Baos, 9, Edif. Gorbea 3, planta
3ºD, 28016 Madrid, Spain
Inscrita en el Reg. Mercantil de Madrid – C.I.F. B82657941 - Red Hat S.L.
___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users


Re: [Users] Unable to add fresh oVirt host

2012-04-27 Thread Shu Ming
How about the ouput of "brctl show" in your ovirt node?  It looks like 
that the right bridge was not created.

On 2012-4-27 12:39, Andrey F. wrote:
On Thu, Apr 26, 2012 at 8:56 PM, Andrey F. > wrote:


Are some more digging. I have discovered the following.

It seems that ovirt is not able to create the bridge. What could
be off?; could I have missed a configuration step or param
somewhere?.


Ugh...I've been "over-debugging"...I was running the script wrong. 
This was getting caught in my params: 
/tmp/vds_bootstrap_f9c3a003-b221-4f7e-ae14-5b53ce31ab72.py script cmd 
= ', hense why script was getting returned in this log line: "Fri, 27 
Apr 2012 03:33:19 DEBUGgetAddress Entry. url=script"


When I run the script correctly, I get the VDS compat output per my 
original post with nothing in the bootstrap log.


is in vds_installer script. It passes "-v" to bootstrap script:

Fri, 27 Apr 2012 03:14:12 DEBUGtrying to run 
/tmp/vds_bootstrap_51b8d414-
a8fa-44f9-8613-f7819255d2eb.py script cmd = 
'/tmp/vds_bootstrap_51b8d414-a8fa-44f9-8613-f7819255d2eb.py -v -O 
salesforce.com  -t 2012-04-27T03:12:27 
http://mgmt.example.com:8080/Components/vds/ node.example.com 
 51b8d414-a8fa-44f9-8613-f7819255d2eb'


I was able to figure that out after changing this:

except:
print main.__doc__
return 0

to this:

except Exception, e:
print e

Why is the exception not printed? Getting this output would have saved 
my a lot of debugging time I feel :(.


It looks like my version of vdsm from rhn: vdsm-4.9-112.6.el6_2.x86_64 
is too old for my ovirt which is at version 
ovirt-engine-3.1.0_0001-1.8.el6.x86_64 built from source.


Note, that I used the following answers file to install ovirt:


[general]
OVERRIDE_IPTABLES=no
HTTP_PORT=8080
HTTPS_PORT=8443
MAC_RANGE=00:1A:4A:A8:7A:00-00:1A:4A:A8:7A:FF
ORG_NAME=example.com 
DC_TYPE=NFS
CONFIG_NFS=no
NFS_MP=
ISO_DOMAIN_NAME=
DB_REMOTE_INSTALL=local
#DB_HOST=localhost
#DB_PORT=5432

HOST_FQDN=mgmt.example.com 
AUTH_PASS=password
DB_LOCAL_PASS=password



On Thu, Apr 26, 2012 at 5:31 PM, Andrey F. mailto:ma3ox...@gmail.com>> wrote:

I am attempting to add the first host to a newly setup oVirt.
Here is the error message that I am getting:

2012-04-27 00:09:23,485 ERROR
[org.ovirt.engine.core.bll.VdsInstaller] (pool-5-thread-50)
[57283fb3] Installation of node.example.com
. No meaningful response recieved
from Host. (Stage: Running first installation script on Host)

The following shows up in engine log before hand or if I try
to run the script manually on the oVirt node:
/tmp/vds_installer_9b9fdf2c-d3e0-425d-bd05-e4e4e53b6602.py -c
'ssl=true;management_port=54321' -O 'example.com
' -t 2012-04-27T00:09:22 -f
/tmp/firewall.conf.9b9fdf2c-d3e0-425d-bd05-e4e4e53b6602 -p
8080 -b -v http://mgmt.example.com:8080/Components/vds/
http://mgmt.example.com:8080/Components/vds/ node.example.com
 9b9fdf2c-d3e0-425d-bd05-e4e4e53b6602
False




Usage: vds_compat.py [-r rev_num] [-O
organizationName] [-t systemTime]
[-n netconsole_host:port] [-u (seProductRepo)
true|false ]
[-f firewall_rules_file ]   

What can I do to figure what could be wrong?





___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users



--
Shu Ming
IBM China Systems and Technology Laboratory

___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users