Re: [Engine-devel] LockManager maybe not be really taking locks in your flows...

2013-08-11 Thread Allon Mureinik


- Original Message -
> From: "Roy Golan" 
> To: "Yair Zaslavsky" 
> Cc: "engine-devel" 
> Sent: Sunday, August 11, 2013 5:16:47 PM
> Subject: Re: [Engine-devel] LockManager maybe not be really taking locks in 
> your flows...
> 
> On Sun 11 Aug 2013 05:14:04 PM IDT, Roy Golan wrote:
> > On Sun 11 Aug 2013 05:03:05 PM IDT, Yair Zaslavsky wrote:
> >> Hi all,
> >> Thanks to Alon Bar Lev's efforts for preventing to concurrent host
> >> installation for the same host entity + Roy Golan's check of the
> >> code, we saw that for commands that override
> >>
> >> getExclusiveLocks() or getSharedLocks() the locking mechanism does
> >> not work (lock is not being acquired) if there is no annotation of
> >> @LockIdNameAttribute on the class.
> >> A bug was filed for removing this annotation (leftover from some
> >> historical code ) , but until it is fixed - bare in mind you need to
> >> add this annotation in current commands you are working on
> >> in order to utilize the mechanism.
> >> See RemoveVmCommand (has the annotation) vs AddDiskCommand (which
> >> doesn't have the annotation)
> >>
> >>
> >> Cheers,
> >> Yair
> >> ___
> >> Engine-devel mailing list
> >> Engine-devel@ovirt.org
> >> http://lists.ovirt.org/mailman/listinfo/engine-devel
> >
> > just to make it clear, the storage commands are calling explicitly
> > aquireLockInternal in the canDoAction. since there is no contract (no
> > interface) we are open to mistakes and misuse. this should be rectified.
> >
> more info from the bug:
> see the list of commands that overrrides getExcelusiveLocks but *don't*
> have the @LockIdNameAttribute annotation:
> 
> bll/src/main/java/org/ovirt/engine/core/bll/AddDiskCommand.java
Manually calls acquireLockInternal() - disgusting, but works (on my todo list 
for some future version, don't worry).

> bll/src/main/java/org/ovirt/engine/core/bll/MoveOrCopyDiskCommand.java
Same.

> bll/src/main/java/org/ovirt/engine/core/bll/AddVdsCommand.java
> bll/src/main/java/org/ovirt/engine/core/bll/UpdateVmTemplateCommand.java
> bll/src/main/java/org/ovirt/engine/core/bll/ExportRepoImageCommand.java
> 
> ___
> Engine-devel mailing list
> Engine-devel@ovirt.org
> http://lists.ovirt.org/mailman/listinfo/engine-devel
> 
___
Engine-devel mailing list
Engine-devel@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-devel


Re: [Engine-devel] [oVirt/RHEV 3.3 Localization Question #13] "${ENTITIES_USING_VNIC_PROFILE_COUNTER}"

2013-08-11 Thread Moti Asayag


- Original Message -
> From: "Yuko Katabami" 
> To: engine-devel@ovirt.org
> Sent: Monday, August 12, 2013 2:28:05 AM
> Subject: [Engine-devel] [oVirt/RHEV 3.3 Localization Question #13]
> "${ENTITIES_USING_VNIC_PROFILE_COUNTER}"
> 
> Hi all,
> 
> I would like to ask for your help again with the following questions:
> 
> File: AppErrors
> Resource ID: ACTION_TYPE_FAILED_VNIC_PROFILE_IN_USE
> Strings: Cannot ${action} ${type}. Several ${entities}
> (${ENTITIES_USING_VNIC_PROFILE_COUNTER}) are using this VM network interface
> profile:
> ${ENTITIES_USING_VNIC_PROFILE}
> - Please remove it from all ${entities} that are using it and try again.
> Question:
> Is "${ENTITIES_USING_VNIC_PROFILE_COUNTER}" representing the number of
> entities using the VNIC profile?

Yes.

> Is it always greater than 1 or could it be 1 in some cases?

It can be 1 or greater.

> Is ${ENTITIES_USING_VNIC_PROFILE} representing the name(s) of entities using
> the the VNIC profile?
> 

Yes.

Here are 2 examples for the error when the vnic profile is used by one or more 
vms:

A vnic profile used by a single entity:
Error while executing action: Cannot remove VM network interface profile. 
Several virtual machines (1) are using this VM network interface profile:
vm1
- Please remove it from all virtual machines that are using it and try again.

A vnic profile used by a two entities:
Error while executing action: Cannot remove VM network interface profile. 
Several virtual machines (2) are using this VM network interface profile:
vm1,
vm2
- Please remove it from all virtual machines that are using it and try again.

> Thank you,
> 
> Yuko
> --
> Regards,
> 
> Yuko Katabami (方波見裕子)
> Technical Translator II
> NAATI Accredited Professional Translator (English into Japanese) #28138
> RHCSA #111-119-244
> Mobile: +61 415 847 352
> Email: ykata...@redhat.com
> 
> 
> 
> Red Hat, Asia-Pacific Pty Ltd
> Level 1, 193 North Quay
> Brisbane 4000
> Office: +61 7 3514 8100
> Fax: +61 7 3514 8199
> Website: www.redhat.com
> 
> Facebook: Red Hat APAC | Red Hat Japan | Red Hat Korea | JBoss APAC
> Twitter: Red Hat APAC | Red Hat ANZ
> LinkedIn: Red Hat APAC | JBoss APAC
> 
> ___
> Engine-devel mailing list
> Engine-devel@ovirt.org
> http://lists.ovirt.org/mailman/listinfo/engine-devel
> 
___
Engine-devel mailing list
Engine-devel@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-devel


Re: [Engine-devel] should we check for active host before activate SD?

2013-08-11 Thread plysan
Hi Liron:
Thanks for your reply, please see comment below.

2013/8/12 Liron Aravot 

>
>
> - Original Message -
> > From: "plysan" 
> > To: engine-devel@ovirt.org
> > Sent: Sunday, August 11, 2013 8:09:19 PM
> > Subject: [Engine-devel] should we check for active host before activate
> SD?
> >
> > Hi all:
> > Currently I get into a situation with a NFS data center which maintained
> both
> > hosts and storage domains.
> > Now if I first activate host then SD, everything works fine. But if I
> > mistakenly first activate SD, the data center gets into a non responsive
> > status, after this if I try to activate a host, it will get into a non
> > operational state, it seems I can't find a way to get the DC running
> again.
> > I think a additional check should be done before activate a SD, and i've
> > uploaded a patch for a solution of this issue:
> http://gerrit.ovirt.org/17940
> > I haven't test with other storage types, but activating a SD need a
> > functioning host, right? correct me if i'm wrong :)
> >
> > Best regards,
> > plysan
> >
>
> Hi plysan,
> which version of oVirt are you using?
>
I'm using the latest build with developer mod

> I'll try to answer to each issue separatly:
> 1. Host doesn't move to "UP" after the following - Some fixes were done to
> avoid such situation from happening - so if you would update that should
> happend.

Do you mean there is already some fix available?

> 2. There's no check for any host being up - if that's missing on the flow,
> it might be added as an improvement, but [1] should get you good to go :)
>
I think engine should not try to connect to SD knowing that there is no
active host, otherwise the action would fail. So the check should be added.
Question is whether there be any situation that SD can be activated
successfully even if there is no 'up' host in storage pool?

>
> Let me know if i could help somehow more
> thanks,
> Liron
> > ___
> > Engine-devel mailing list
> > Engine-devel@ovirt.org
> > http://lists.ovirt.org/mailman/listinfo/engine-devel
> >
>
___
Engine-devel mailing list
Engine-devel@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-devel


Re: [Engine-devel] [oVirt/RHEV 3.3 Localization Question #14] "No Position"

2013-08-11 Thread Yuko Katabami

  
  

On 08/12/2013 04:00 PM, Gilad Chaplik
  wrote:


  - Original Message -

  
From: "Yuko Katabami" 
To: engine-devel@ovirt.org
Sent: Monday, August 12, 2013 5:07:59 AM
Subject: [Engine-devel] [oVirt/RHEV 3.3 Localization Question #14] "No	Position"

Hello again.

I would like to ask one more question with the following details:

File: ApplicationConstants
Resource ID: noPositionFilter
Strings: No Position
Question: Could anyone please explain the usage of this string and where in
the Admin Portal it appears?

  
  
Hi Yuko,

Configure -> Cluster Policies.
when adding a filter you may specify it will be invoked first/last in line. 
to remove it from being first/last to no position, use context menu on the selected filter.

Thanks, 
Gilad.

Hi Gilad,

Thank you very much for your prompt reply and explaining it clearly.
I understand it now and can translate the string appropriately.

Kind regards,

Yuko

  


  

Thank you,

Yuko


--
Regards,

Yuko Katabami (方波見裕子)
Technical Translator II
NAATI Accredited Professional Translator (English into Japanese) #28138
RHCSA #111-119-244
Mobile: +61 415 847 352
Email: ykata...@redhat.com



Red Hat, Asia-Pacific Pty Ltd
Level 1, 193 North Quay
Brisbane 4000
Office: +61 7 3514 8100
Fax: +61 7 3514 8199
Website: www.redhat.com

Facebook: Red Hat APAC | Red Hat Japan | Red Hat Korea | JBoss APAC
Twitter: Red Hat APAC | Red Hat ANZ
LinkedIn: Red Hat APAC | JBoss APAC

___
Engine-devel mailing list
Engine-devel@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-devel


  


-- 
   Regards,


Yuko Katabami (方波見裕子) 
Technical Translator II 
NAATI Accredited Professional Translator (English into Japanese)
#28138 
RHCSA #111-119-244 
Mobile: +61 415 847 352 
Email: ykata...@redhat.com 

 

Red Hat, Asia-Pacific Pty Ltd 
Level 1, 193 North Quay 
Brisbane 4000 
Office: +61 7 3514 8100 
Fax: +61 7 3514 8199 
Website: www.redhat.com


Facebook: Red Hat APAC | Red
  Hat Japan | Red Hat Korea | JBoss
  APAC 
Twitter: Red Hat APAC | Red
  Hat ANZ 
LinkedIn: Red Hat APAC | JBoss APAC
  

  

___
Engine-devel mailing list
Engine-devel@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-devel


Re: [Engine-devel] [oVirt/RHEV 3.3 Localization Question #14] "No Position"

2013-08-11 Thread Gilad Chaplik
- Original Message -
> From: "Yuko Katabami" 
> To: engine-devel@ovirt.org
> Sent: Monday, August 12, 2013 5:07:59 AM
> Subject: [Engine-devel] [oVirt/RHEV 3.3 Localization Question #14] "No
> Position"
> 
> Hello again.
> 
> I would like to ask one more question with the following details:
> 
> File: ApplicationConstants
> Resource ID: noPositionFilter
> Strings: No Position
> Question: Could anyone please explain the usage of this string and where in
> the Admin Portal it appears?

Hi Yuko,

Configure -> Cluster Policies.
when adding a filter you may specify it will be invoked first/last in line. 
to remove it from being first/last to no position, use context menu on the 
selected filter.

Thanks, 
Gilad.

> 
> Thank you,
> 
> Yuko
> 
> 
> --
> Regards,
> 
> Yuko Katabami (方波見裕子)
> Technical Translator II
> NAATI Accredited Professional Translator (English into Japanese) #28138
> RHCSA #111-119-244
> Mobile: +61 415 847 352
> Email: ykata...@redhat.com
> 
> 
> 
> Red Hat, Asia-Pacific Pty Ltd
> Level 1, 193 North Quay
> Brisbane 4000
> Office: +61 7 3514 8100
> Fax: +61 7 3514 8199
> Website: www.redhat.com
> 
> Facebook: Red Hat APAC | Red Hat Japan | Red Hat Korea | JBoss APAC
> Twitter: Red Hat APAC | Red Hat ANZ
> LinkedIn: Red Hat APAC | JBoss APAC
> 
> ___
> Engine-devel mailing list
> Engine-devel@ovirt.org
> http://lists.ovirt.org/mailman/listinfo/engine-devel
>___
Engine-devel mailing list
Engine-devel@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-devel


[Engine-devel] Gluster Volume asynchronous tasks

2013-08-11 Thread Sahina Bose

Hi all,

We are working on a feature to add support to start and monitor gluster 
volume asynchronous tasks (like rebalancing a gluster volume, removing 
brick from volume ) from the oVirt engine.


The operations can be started from the Volumes tab or the Bricks sub-tab 
using the Rebalance, Remove options.
These are long running operations which can be monitored using a task id 
returned from Gluster. We are planning to add the monitoring in the 
existing Task sub tab


The feature description and User flows are at 
http://www.ovirt.org/Features/Gluster_Volume_Asynchronous_Tasks_Management


The detailed design (including REST API design) is at 
http://www.ovirt.org/Features/Detailed_Gluster_Volume_Asynchronous_Tasks_Management.


I would really appreciate if you could review and provide your valuable 
feedback.


thanks
sahina
___
Engine-devel mailing list
Engine-devel@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-devel


Re: [Engine-devel] should we check for active host before activate SD?

2013-08-11 Thread Liron Aravot


- Original Message -
> From: "plysan" 
> To: engine-devel@ovirt.org
> Sent: Sunday, August 11, 2013 8:09:19 PM
> Subject: [Engine-devel] should we check for active host before activate SD?
> 
> Hi all:
> Currently I get into a situation with a NFS data center which maintained both
> hosts and storage domains.
> Now if I first activate host then SD, everything works fine. But if I
> mistakenly first activate SD, the data center gets into a non responsive
> status, after this if I try to activate a host, it will get into a non
> operational state, it seems I can't find a way to get the DC running again.
> I think a additional check should be done before activate a SD, and i've
> uploaded a patch for a solution of this issue: http://gerrit.ovirt.org/17940
> I haven't test with other storage types, but activating a SD need a
> functioning host, right? correct me if i'm wrong :)
> 
> Best regards,
> plysan
> 

Hi plysan,
which version of oVirt are you using?
I'll try to answer to each issue separatly:
1. Host doesn't move to "UP" after the following - Some fixes were done to 
avoid such situation from happening - so if you would update that should 
happend.
2. There's no check for any host being up - if that's missing on the flow, it 
might be added as an improvement, but [1] should get you good to go :)

Let me know if i could help somehow more
thanks,
Liron
> ___
> Engine-devel mailing list
> Engine-devel@ovirt.org
> http://lists.ovirt.org/mailman/listinfo/engine-devel
> 
___
Engine-devel mailing list
Engine-devel@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-devel


[Engine-devel] [oVirt/RHEV 3.3 Localization Question #14] "No Position"

2013-08-11 Thread Yuko Katabami

  
  
Hello again.

I would like to ask one more question with the following details:

File: ApplicationConstants
Resource ID: 

noPositionFilter
Strings: No Position
Question: Could anyone please explain the usage of this
string and where in the Admin Portal it appears?

Thank you,

Yuko


-- 
   Regards,


Yuko Katabami (方波見裕子) 
Technical Translator II 
NAATI Accredited Professional Translator (English into Japanese)
#28138 
RHCSA #111-119-244 
Mobile: +61 415 847 352 
Email: ykata...@redhat.com 

 

Red Hat, Asia-Pacific Pty Ltd 
Level 1, 193 North Quay 
Brisbane 4000 
Office: +61 7 3514 8100 
Fax: +61 7 3514 8199 
Website: www.redhat.com


Facebook: Red Hat APAC | Red
  Hat Japan | Red Hat Korea | JBoss
  APAC 
Twitter: Red Hat APAC | Red
  Hat ANZ 
LinkedIn: Red Hat APAC | JBoss APAC
  

  

___
Engine-devel mailing list
Engine-devel@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-devel


[Engine-devel] [oVirt/RHEV 3.3 Localization Question #13] "${ENTITIES_USING_VNIC_PROFILE_COUNTER}"

2013-08-11 Thread Yuko Katabami

  
  
Hi all, 

I would like to ask for your help again with the following
questions:

File: AppErrors

Resource ID: ACTION_TYPE_FAILED_VNIC_PROFILE_IN_USE
Strings: Cannot ${action} ${type}. Several
${entities} (${ENTITIES_USING_VNIC_PROFILE_COUNTER}) are using this
VM network interface profile:
${ENTITIES_USING_VNIC_PROFILE}
 - Please remove it from all ${entities} that are using it and try
again.
Question: 
Is "${ENTITIES_USING_VNIC_PROFILE_COUNTER}" representing the number
of entities using the VNIC profile? 
Is it always greater than 1 or could it be 1 in some cases?
Is ${ENTITIES_USING_VNIC_PROFILE} representing the name(s) of
entities using the the VNIC profile?

Thank you,

Yuko
-- 
   Regards,


Yuko Katabami (方波見裕子) 
Technical Translator II 
NAATI Accredited Professional Translator (English into Japanese)
#28138 
RHCSA #111-119-244 
Mobile: +61 415 847 352 
Email: ykata...@redhat.com 

 

Red Hat, Asia-Pacific Pty Ltd 
Level 1, 193 North Quay 
Brisbane 4000 
Office: +61 7 3514 8100 
Fax: +61 7 3514 8199 
Website: www.redhat.com


Facebook: Red Hat APAC | Red
  Hat Japan | Red Hat Korea | JBoss
  APAC 
Twitter: Red Hat APAC | Red
  Hat ANZ 
LinkedIn: Red Hat APAC | JBoss APAC
  

  

___
Engine-devel mailing list
Engine-devel@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-devel


[Engine-devel] should we check for active host before activate SD?

2013-08-11 Thread plysan
Hi all:
Currently I get into a situation with a NFS data center which maintained
both hosts and storage domains.
Now if I first activate host then SD, everything works fine. But if I
mistakenly first activate SD, the data center gets into a non responsive
status, after this if I try to activate a host, it will get into a non
operational state, it seems I can't find a way to get the DC running again.
I think a additional check should be done before activate a SD, and i've
uploaded a patch for a solution of this issue: http://gerrit.ovirt.org/17940
I haven't test with other storage types, but activating a SD need a
functioning host, right? correct me if i'm wrong :)

Best regards,
plysan
___
Engine-devel mailing list
Engine-devel@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-devel


Re: [Engine-devel] LockManager maybe not be really taking locks in your flows...

2013-08-11 Thread Roy Golan

On Sun 11 Aug 2013 05:14:04 PM IDT, Roy Golan wrote:

On Sun 11 Aug 2013 05:03:05 PM IDT, Yair Zaslavsky wrote:

Hi all,
Thanks to Alon Bar Lev's efforts for preventing to concurrent host
installation for the same host entity + Roy Golan's check of the
code, we saw that for commands that override

getExclusiveLocks() or getSharedLocks() the locking mechanism does
not work (lock is not being acquired) if there is no annotation of
@LockIdNameAttribute on the class.
A bug was filed for removing this annotation (leftover from some
historical code ) , but until it is fixed - bare in mind you need to
add this annotation in current commands you are working on
in order to utilize the mechanism.
See RemoveVmCommand (has the annotation) vs AddDiskCommand (which
doesn't have the annotation)


Cheers,
Yair
___
Engine-devel mailing list
Engine-devel@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-devel


just to make it clear, the storage commands are calling explicitly
aquireLockInternal in the canDoAction. since there is no contract (no
interface) we are open to mistakes and misuse. this should be rectified.


more info from the bug:
see the list of commands that overrrides getExcelusiveLocks but *don't* 
have the @LockIdNameAttribute annotation:


bll/src/main/java/org/ovirt/engine/core/bll/AddDiskCommand.java
bll/src/main/java/org/ovirt/engine/core/bll/MoveOrCopyDiskCommand.java
bll/src/main/java/org/ovirt/engine/core/bll/AddVdsCommand.java
bll/src/main/java/org/ovirt/engine/core/bll/UpdateVmTemplateCommand.java
bll/src/main/java/org/ovirt/engine/core/bll/ExportRepoImageCommand.java

___
Engine-devel mailing list
Engine-devel@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-devel


Re: [Engine-devel] LockManager maybe not be really taking locks in your flows...

2013-08-11 Thread Roy Golan

On Sun 11 Aug 2013 05:03:05 PM IDT, Yair Zaslavsky wrote:

Hi all,
Thanks to Alon Bar Lev's efforts for preventing to concurrent host installation 
for the same host entity + Roy Golan's check of the code, we saw that for 
commands that override

getExclusiveLocks() or getSharedLocks() the locking mechanism does not work 
(lock is not being acquired) if there is no annotation of @LockIdNameAttribute 
on the class.
A bug was filed for removing this annotation (leftover from some historical 
code ) , but until it is fixed - bare in mind you need to add this annotation 
in current commands you are working on
in order to utilize the mechanism.
See RemoveVmCommand (has the annotation) vs AddDiskCommand (which doesn't have 
the annotation)


Cheers,
Yair
___
Engine-devel mailing list
Engine-devel@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-devel


just to make it clear, the storage commands are calling explicitly 
aquireLockInternal in the canDoAction. since there is no contract (no 
interface) we are open to mistakes and misuse. this should be rectified.


___
Engine-devel mailing list
Engine-devel@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-devel


[Engine-devel] LockManager maybe not be really taking locks in your flows...

2013-08-11 Thread Yair Zaslavsky
Hi all,
Thanks to Alon Bar Lev's efforts for preventing to concurrent host installation 
for the same host entity + Roy Golan's check of the code, we saw that for 
commands that override

getExclusiveLocks() or getSharedLocks() the locking mechanism does not work 
(lock is not being acquired) if there is no annotation of @LockIdNameAttribute 
on the class.
A bug was filed for removing this annotation (leftover from some historical 
code ) , but until it is fixed - bare in mind you need to add this annotation 
in current commands you are working on 
in order to utilize the mechanism.
See RemoveVmCommand (has the annotation) vs AddDiskCommand (which doesn't have 
the annotation)


Cheers,
Yair
___
Engine-devel mailing list
Engine-devel@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-devel


[Engine-devel] clean testable code

2013-08-11 Thread Giuseppe Vallarelli
Talking with my teammates I've noticed that there is some confusion related to 
what testing means and in general
how tests can improve the quality of the codebase by favouring the development 
of components that are of higher
quality - unluckily it doesn't favour hair regrowing. Tests are also cool 
because when done right they represent
an executable form of documentation.

Some intro material:

1 How to Write Clean, Testable Code by Miško Hevery (A Googler)
  http://www.youtube.com/watch?v=XcT4yYu_TTs

2 How to write testable code by Miško Hevery (hands on ;-))
  http://misko.hevery.com/attachments/Guide-Writing%20Testable%20Code.pdf
  Examples are provided in Java but the same principles apply to Python
  as well.

3 TDD by James Shore (a practice created by Kent Beck)
  http://www.jamesshore.com/Agile-Book/test_driven_development.html
  A broad article explaining TDD and related concepts.

4 Difference between state based testing and interaction based testing
  http://martinfowler.com/articles/mocksArentStubs.html

Not so intro - but easier to understand after consuming previous material:

5 Mock Roles, not Objects by Freeman and Pryce
  http://jmock.org/oopsla2004.pdf
  They both wrote a very interesting book: Growing Object Oriented Software: 
Guided by Tests
  
http://www.amazon.com/Growing-Object-Oriented-Software-Guided-Tests/dp/0321503627/ref=cm_cr_pr_product_top
  I didn't read it yet.

Points from 3 to 5 mostly describe a different kind of working practice, which 
is very
opinionated but nevertheless with some interesting ideas. I consider points 1-2 
fundamentals.

Enjoy, Giuseppe

I will share new materials if there's some interest on it.
___
Engine-devel mailing list
Engine-devel@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-devel