[one-users] describe terminated instances with econe server

Daniel Molina dmolina at opennebula.org
Wed Feb 5 08:02:00 PST 2014


Hi Mark,


On 5 February 2014 16:45, Mark Gergely <gergely.mark at sztaki.mta.hu> wrote:

> Dear All,
>
> I believe that there is a bug with handling of the
> :describe_with_terminated_instances: econe server configuration variable.
> The variable gets evaluated in the include_terminated_instances? method
> (instance.rb file). The method works like
> this: @config[:describe_with_terminated_instances] ||
> DESCRIBE_WITH_TERMINATED_INSTANCES, but the second constant is always true,
> therefore the config parameter won't affect the return value, it will
> always be true.
> I think that the second constant is useless and it should be removed.
> also there is a spare equal mark in the default config
> file: :describe_with_terminated_instances: *=* true
>

You are right it is a bug. The constant is there in case you are using an
old conf file, to be included by default. It should look like this:

diff --git a/src/cloud/ec2/etc/econe.conf b/src/cloud/ec2/etc/econe.conf
index d9c2e59..1114d09 100644
--- a/src/cloud/ec2/etc/econe.conf
+++ b/src/cloud/ec2/etc/econe.conf
@@ -65,7 +65,7 @@
 #:datastore_id:

 # Include terminated instances in the describe_instances xml
-:describe_with_terminated_instances: = true
+:describe_with_terminated_instances: true
 # Terminated VMs will be included in the list
 #  till the termination date + TERMINATED_INSTANCES_EXPIRATION_TIME is
reached
 :terminated_instances_expiration_time: 900
diff --git a/src/cloud/ec2/lib/instance.rb b/src/cloud/ec2/lib/instance.rb
index 179616d..1d069a8 100644
--- a/src/cloud/ec2/lib/instance.rb
+++ b/src/cloud/ec2/lib/instance.rb
@@ -340,7 +340,11 @@ module Instance
     end

     def include_terminated_instances?
-        @config[:describe_with_terminated_instances] ||
DESCRIBE_WITH_TERMINATED_INSTANCES
+        if @config[:describe_with_terminated_instances].nil?
+            DESCRIBE_WITH_TERMINATED_INSTANCES
+        else
+            @config[:describe_with_terminated_instances]
+        end
     end

Thank you for your feedback


> All the best,
> Mark Gergely
> MTA SZTAKI LPDS
>
> _______________________________________________
> Users mailing list
> Users at lists.opennebula.org
> http://lists.opennebula.org/listinfo.cgi/users-opennebula.org
>
>


-- 
--
Daniel Molina
Project Engineer
OpenNebula - Flexible Enterprise Cloud Made Simple
www.OpenNebula.org | dmolina at opennebula.org | @OpenNebula
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opennebula.org/pipermail/users-opennebula.org/attachments/20140205/7d351d93/attachment-0002.htm>


More information about the Users mailing list