Opennebula 5.8:Column for Description in command onevm list (CLI)

(telecast) #1

Hi,
I faced with issue, can’t add showing the column “Description”
In 5.6 and older version it did work.
My step:
to patch files: onevm_helper.rb, onevm.yaml

  1. /usr/lib/one/ruby/cli/one_helper/
# cat patch_onevm_helper.txt 
--- onevm_helper.rb	2019-03-11 15:49:29.224295092 +0300
+++ onevm_helper.rb.description	2019-03-11 15:49:49.400383268 +0300
@@ -371,8 +371,12 @@
                 OneVMHelper.ip_str(d)
             end
 
+            column :DESCRIPTION, "DESCRIPTION", :size=>12 do |d|
+                d["USER_TEMPLATE"]["DESCRIPTION"]
+            end
+
             default :ID, :USER, :GROUP, :NAME, :STAT, :UCPU, :UMEM, :HOST,
-                :TIME
+                :TIME, :DESCRIPTION
         end
 
         table
  1. ~oneadmin/.one/cli/
$ cat patch_onevm.txt 
--- .one/cli/onevm.yaml	2019-03-11 15:24:47.202367286 +0300
+++ .one/cli/onevm.yaml.rpmsave	2019-03-11 11:56:48.129511773 +0300
@@ -5,7 +5,7 @@
 
 :NAME:
   :desc: Name of the Virtual Machine
-  :size: 30
+  :size: 15
   :left: true
 
 :USER:
@@ -52,7 +52,6 @@
 :DESCRIPTION:
   :desc: DESCRIPTION
   :size: 30
-  :left: true
 
 :default:
 - :ID
@@ -76,4 +75,4 @@
     - :UMEM
     - :HOST
     - :TIME
-    - :DESCRIPTION
+    - :DESCRIPTION
\ No newline at end of file

Thank you for your help!

(telecast) #2

It’s seems up to version 5.6, the “onevm list” command gives info the description which containing into the USER TEMPLATE in XML code.

 <USER_TEMPLATE>
    <DESCRIPTION><![CDATA[some text about VM]]></DESCRIPTION>
    *****
  </USER_TEMPLATE>

Beginning the version of 5.8 the USER TEMPLATE I can get only via command "onevm show "

(Christian Gonzalez) #3

In OpenNebula 5.8.0 some of the VM attributes were removed from the VM_POOL in order to decrease its size and improve the performance on large deployments. If you need those attributes you can use the --extended option for getting all the VMs attributes.

If you need to modify the current behavior of onevm list command you can modify it and force it to call one.vmpool.infoextended instead of one.vmpool.info

(telecast) #4

@Christian_Gonzalez

Thank you for you reply!
Great,thanks for the tip. Now I can see DESCRIPTION in xml and will be to try parse it.