You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cloudstack.apache.org by syed <gi...@git.apache.org> on 2017/01/16 16:31:33 UTC

[GitHub] cloudstack pull request #1906: CLOUDSTACK-9743 - ODL plugin responds to dele...

GitHub user syed opened a pull request:

    https://github.com/apache/cloudstack/pull/1906

    CLOUDSTACK-9743 - ODL plugin responds to deleteHost causing other plugin in the chain to be ignored 

    I found this bug when writing a plugin for Baremetal. What happens is that when a host is deleted, it goes through a list of all registered plugins and calls the deleteHost for each plugin. See `ResourceManagerImpl.java:dispatchToStateAdapters` and it stops as soon as someone returns a deleteAnswer. 
    
    Now in case of ODL, it returns a valid answer irrespective of any condition. This causes the other plugins which are supposed to handle this delete request to be skipped. I am returning `null` here so that Cloudstack will continue further and keep calling other agents which can correctly handle the delete request. 

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/syed/cloudstack odl-deletehost-fix

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/cloudstack/pull/1906.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1906
    
----
commit d7b0c728f0e6dfc5b418260674ec2b735f921c45
Author: Syed <sy...@gmail.com>
Date:   2016-12-14T16:38:34Z

    CLOUDSTACK-9363: Fix HVM VM restart bug in XenServer

commit 04c2007d27ed0c01bcb4dc93ec3a803ec2f7186a
Author: Syed <sy...@gmail.com>
Date:   2017-01-13T16:39:50Z

    Merge branch 'master' of https://github.com/apache/cloudstack

commit 2ebc32ae2c426b46c5b1e416597317678e1fb9bc
Author: Syed <sy...@gmail.com>
Date:   2017-01-16T16:25:15Z

    Return null when deleting host in ODL

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Re: [GitHub] cloudstack pull request #1906: CLOUDSTACK-9743 - ODL plugin responds to dele...

Posted by Syed Ahmed <sa...@cloudops.com>.
If no action is being taken, the valid answer is to return null. This will
make the listener logic to try the next listener

On Thu, Feb 9, 2017 at 6:00 AM, koushik-das <gi...@git.apache.org> wrote:

> Github user koushik-das commented on a diff in the pull request:
>
>     https://github.com/apache/cloudstack/pull/1906#discussion_r100281158
>
>     --- Diff: plugins/network-elements/opendaylight/src/main/java/
> org/apache/cloudstack/network/opendaylight/OpendaylightElement.java ---
>     @@ -156,7 +153,7 @@ public HostVO createHostVOForDirectConnectAgent(HostVO
> host, StartupCommand[] st
>
>          @Override
>          public DeleteHostAnswer deleteHost(HostVO host, boolean isForced,
> boolean isForceDeleteStorage) throws UnableDeleteHostException {
>     -        return new DeleteHostAnswer(true);
>     +        return null;
>     --- End diff --
>
>     @syed I am not sure if this is used or maintained by anyone. But the
> right fix may be to use some checks to return a valid answer or null. How
> is this handled in some of the other network elements?
>
>
> ---
> If your project is set up for it, you can reply to this email and have your
> reply appear on GitHub as well. If your project does not have this feature
> enabled and wishes so, or if the feature is enabled but not working, please
> contact infrastructure at infrastructure@apache.org or file a JIRA ticket
> with INFRA.
> ---
>

[GitHub] cloudstack pull request #1906: CLOUDSTACK-9743 - ODL plugin responds to dele...

Posted by koushik-das <gi...@git.apache.org>.
Github user koushik-das commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1906#discussion_r100281158
  
    --- Diff: plugins/network-elements/opendaylight/src/main/java/org/apache/cloudstack/network/opendaylight/OpendaylightElement.java ---
    @@ -156,7 +153,7 @@ public HostVO createHostVOForDirectConnectAgent(HostVO host, StartupCommand[] st
     
         @Override
         public DeleteHostAnswer deleteHost(HostVO host, boolean isForced, boolean isForceDeleteStorage) throws UnableDeleteHostException {
    -        return new DeleteHostAnswer(true);
    +        return null;
    --- End diff --
    
    @syed I am not sure if this is used or maintained by anyone. But the right fix may be to use some checks to return a valid answer or null. How is this handled in some of the other network elements?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---