Allocated CPU and Memory showing "0" after adding vcenter in opennebula

Hi,

After adding vCenter in opennebula. If i will see “hosts” it is showing “0” allocated resource value for CPU and Memory.

After adding vcenter in opennebula, i can see ESX’s datastore in host properties, but not able to add the same into “datastore” to use.

I have two nodes:
Opennebula: 5.0 try out version running on Virtualbox separate node.
ESXi 6 and vCenter running on separate node

Can someone help…

Hi Amit!
welcome to the forum! I’ll try to answer your questions.

After adding vCenter in opennebula. If i will see “hosts” it is showing “0” allocated resource value for CPU and Memory.

That would be fine. When you import a vCenter cluster which is seen as an OpenNebula host, OpenNebula will show 0 for allocated CPU and Memory as you’ve not still deployed any VM from OpenNebula. As soon as you deploy VMs the allocated value won’t be 0.

After adding vcenter in opennebula, i can see ESX’s datastore in host properties, but not able to add the same into “datastore” to use.

Importing or creating the hosts is the first thing you should do, then if you want to import the datastores so you can see them in Storage -> Datastores, you should import them using the CLI (onevcenter command) or using Sunstone’s import button. I’d suggest you to read the docs about vcenter datastores so you can view the process and check the current limitations with vcenter datastores.

Cheers!

Thanks… Yes i am able to do it now…vCenter datastore is imported as presistent in opennebula.
but, I am facing new issue now… Weather i download an image from market place or i try to use imported template of vCenter. I am not able to deploy VM’s using them… please help.

Below is the error while, try to deploy VM using template imported from vCenter.

Mon Nov 21 16:49:55 2016 [Z0][VM][I]: New state is ACTIVE
Mon Nov 21 16:49:55 2016 [Z0][VM][I]: New LCM state is PROLOG
Mon Nov 21 16:49:55 2016 [Z0][VM][I]: New LCM state is BOOT
Mon Nov 21 16:49:55 2016 [Z0][VMM][I]: Generating deployment file: /var/lib/one/vms/13/deployment.0
Mon Nov 21 16:49:55 2016 [Z0][VMM][I]: Successfully execute network driver operation: pre.
Mon Nov 21 16:49:56 2016 [Z0][VMM][I]: Command execution fail: /var/lib/one/remotes/vmm/vcenter/deploy ‘/var/lib/one/vms/13/deployment.0’ ‘ESX-CLS’ 13 ESX-CLS
Mon Nov 21 16:49:56 2016 [Z0][VMM][I]: Deploy of VM 13 on host ESX-CLS with /var/lib/one/vms/13/deployment.0 failed due to "Cannot find vCenter element in VM template."
Mon Nov 21 16:49:56 2016 [Z0][VMM][I]: ExitCode: 255
Mon Nov 21 16:49:56 2016 [Z0][VMM][I]: Failed to execute virtualization driver operation: deploy.
Mon Nov 21 16:49:56 2016 [Z0][VMM][E]: Error deploying virtual machine
Mon Nov 21 16:49:56 2016 [Z0][VM][I]: New LCM state is BOOT_FAILURE

Morning Amit!
if you’re starting with OpenNebula and vCenter, I’d start creating a VM template in vCenter and then I’d import it using the import button or the CLI (onevcenter command) and then I’d instantiate that VM and check if it deploys the VM. If it fails please post the log for that VM and also run onevm show VMID -x (where VMID is the ID of the VM) and onetemplate show TEMPLATEID -x (where TEMPLATEID is the ID of the template you’re using for your failing VM).

According to your log, OpenNebula “Cannot find vCenter element in VM template” I’d bet that’s because there is no USER_TEMPLATE/PUBLIC_CLOUD element in your VM template. Perhaps you tried to create the template by hand and forgot to specify that element. If you create templates by hand (not importing them) have a look at this section in the docs.

Cheers!

Hi Find the requested logs…
Log> while creating VM from exported template from vcenter

Thu Nov 24 00:58:37 2016 [Z0][VM][I]: New state is ACTIVE
Thu Nov 24 00:58:37 2016 [Z0][VM][I]: New LCM state is PROLOG
Thu Nov 24 00:58:37 2016 [Z0][VM][I]: New LCM state is BOOT
Thu Nov 24 00:58:37 2016 [Z0][VMM][I]: Generating deployment file: /var/lib/one/vms/3/deployment.0
Thu Nov 24 00:58:37 2016 [Z0][VMM][I]: Successfully execute network driver operation: pre.
Thu Nov 24 00:58:37 2016 [Z0][VMM][I]: Command execution fail: /var/lib/one/remotes/vmm/vcenter/deploy ‘/var/lib/one/vms/3/deployment.0’ ‘ESX-CLS’ 3 ESX-CLS
Thu Nov 24 00:58:37 2016 [Z0][VMM][I]: /usr/lib/one/ruby/vendors/rbvmomi/lib/rbvmomi/type_loader.rb:66: warning: already initialized constant RbVmomi::VIM::Datastore
Thu Nov 24 00:58:37 2016 [Z0][VMM][I]: /usr/lib/one/ruby/vcenter_driver.rb:51: warning: previous definition of Datastore was here
Thu Nov 24 00:58:37 2016 [Z0][VMM][I]: Deploy of VM 3 on host ESX-CLS with /var/lib/one/vms/3/deployment.0 failed due to "Cannot clone VM Template: InvalidArgument: A specified parameter was not correct: "
Thu Nov 24 00:58:37 2016 [Z0][VMM][I]: ExitCode: 255
Thu Nov 24 00:58:37 2016 [Z0][VMM][I]: Failed to execute virtualization driver operation: deploy.
Thu Nov 24 00:58:37 2016 [Z0][VMM][E]: Error deploying virtual machine
Thu Nov 24 00:58:37 2016 [Z0][VM][I]: New LCM state is BOOT_FAILURE

[root@one-sandbox ~]# onetemplate show 1
TEMPLATE 1 INFORMATION
ID : 1
NAME : ESX - 192.168.1.70
USER : oneadmin
GROUP : oneadmin
REGISTER TIME : 11/23 21:30:26

PERMISSIONS
OWNER : um-
GROUP : um-
OTHER : um-

TEMPLATE CONTENTS
CPU=".2"
DESCRIPTION="vCenter Template imported by OpenNebula from Cluster 192.168.1.70"
HYPERVISOR="vcenter"
KEEP_DISKS_ON_DONE="NO"
LOGO="images/logos/linux.png"
MEMORY="1024"
PUBLIC_CLOUD=[
TYPE=“vcenter”,
VM_TEMPLATE=“564d9103-04ed-7622-71f3-12725a153d5d” ]
SCHED_REQUIREMENTS="ID="4""
VCENTER_DATASTORE=“datastoredisk”
[root@one-sandbox ~]#

root@one-sandbox ~]# onevm show 0
VIRTUAL MACHINE 0 INFORMATION
ID : 0
NAME : 1
USER : oneadmin
GROUP : oneadmin
STATE : ACTIVE
LCM_STATE : BOOT_FAILURE
RESCHED : No
HOST : ESX-CLS
CLUSTER ID : 0
CLUSTER : default
START TIME : 11/24 00:36:57
END TIME : -
DEPLOY ID : -

VIRTUAL MACHINE MONITORING

PERMISSIONS
OWNER : um-
GROUP : —
OTHER : —

VM DISKS
ID DATASTORE TARGET IMAGE SIZE TYPE SAVE
0 - hda CONTEXT -/- - -

VIRTUAL MACHINE HISTORY
SEQ HOST ACTION DS START TIME PROLOG
0 ESX-CLS none -1 11/24 00:37:12 0d 00h30m 0h00m00s

USER TEMPLATE
DESCRIPTION="vCenter Template imported by OpenNebula from Cluster 192.168.1.70"
HYPERVISOR="vcenter"
KEEP_DISKS_ON_DONE="NO"
LOGO="images/logos/linux.png"
PUBLIC_CLOUD=[
TYPE=“vcenter”,
VM_TEMPLATE=“564d9103-04ed-7622-71f3-12725a153d5d” ]
SCHED_REQUIREMENTS="NAME="192.168.1.70""
VCENTER_DATASTORE=“datastoredisk”

VIRTUAL MACHINE TEMPLATE
AUTOMATIC_REQUIREMENTS="!(PUBLIC_CLOUD = YES) | (PUBLIC_CLOUD = YES & (HYPERVISOR = vcenter))“
CONTEXT=[
DISK_ID=“0”,
NETWORK=“YES”,
SSH_PUBLIC_KEY=”",
TARGET=“hda” ]
CPU="0.2"
GRAPHICS=[
LISTEN=“0.0.0.0”,
PORT=“5900”,
TYPE=“VNC” ]
MEMORY="1024"
TEMPLATE_ID="1"
VMID=“0”
[root@one-sandbox ~]#

Again while exporting vcenter datastore it says no new data store to export… not sure why
[root@one-sandbox ~]# onevcenter datastores --vcenter 192.168.1.30 --vuser oneadmin@vsphere.local --vpass Test@123user

Connecting to vCenter: 192.168.1.30…done!

Looking for Datastores…done!

Do you want to process datacenter Pri-DC-1 [y/n]? y
No new Datastores found in Pri-DC-1…

[root@one-sandbox ~]# onehost show 4
HOST 4 INFORMATION
ID : 4
NAME : ESX-CLS
CLUSTER : default
STATE : MONITORED
IM_MAD : vcenter
VM_MAD : vcenter
LAST MONITORING TIME : 11/24 01:03:56

HOST SHARES
TOTAL MEM : 0K
USED MEM (REAL) : 0K
USED MEM (ALLOCATED) : 4G
TOTAL CPU : 0
USED CPU (REAL) : 0
USED CPU (ALLOCATED) : 80
RUNNING VMS : 4

MONITORING INFORMATION
AVAILHOST="0"
CPUSPEED="NaN"
HYPERVISOR="vcenter"
IM_MAD="vcenter"
PUBLIC_CLOUD=“YES"
RESERVED_CPU=”“
RESERVED_MEM=”"
TOTALHOST="0"
VCENTER_DATASTORE="datastore"
VCENTER_DATASTORE="datastoredisk"
VCENTER_DATASTORE="usbds"
VCENTER_HOST="192.168.1.30"
VCENTER_PASSWORD="4Tv2RXBGzYGdZSwLZVgKOw=="
VCENTER_USER="oneadmin@vsphere.local"
VM_MAD=“vcenter”

WILD VIRTUAL MACHINES

NAME IMPORT_ID CPU MEM ORY

VIRTUAL MACHINES

ID USER     GROUP    NAME            STAT UCPU    UMEM HOST             TIME
 0 oneadmin oneadmin 1               fail    0      0K ESX-CLS      0d 00h27
 1 oneadmin oneadmin 2               fail    0      0K ESX-CLS      0d 00h17
 2 oneadmin oneadmin 3               fail    0      0K ESX-CLS      0d 00h15
 3 oneadmin oneadmin 5               fail    0      0K ESX-CLS      0d 00h06

[root@one-sandbox ~]#

[root@one-sandbox ~]# onedatastore list
ID NAME SIZE AVAIL CLUSTERS IMAGES TYPE DS TM STAT
0 system - - 0 0 sys - ssh on
1 default 9.1G 78% 0 1 img fs ssh on
2 files 9.1G 78% 0 0 fil fs ssh on
100 datastore 0M - 100 0 img vmfs vmfs on
101 datastoredisk 9.1G 78% 100 0 img fs shared on
[root@one-sandbox ~]#

[root@one-sandbox ~]# onedatastore list
ID NAME SIZE AVAIL CLUSTERS IMAGES TYPE DS TM STAT
0 system - - 0 0 sys - ssh on
1 default 9.1G 78% 0 1 img fs ssh on
2 files 9.1G 78% 0 0 fil fs ssh on
100 datastore 0M - 100 0 img vmfs vmfs on
101 datastoredisk 9.1G 78% 100 0 img fs shared on

[root@one-sandbox ~]# onedatastore show 100
DATASTORE 100 INFORMATION
ID : 100
NAME : datastore
USER : oneadmin
GROUP : oneadmin
CLUSTERS : 100
TYPE : IMAGE
DS_MAD : vmfs
TM_MAD : vmfs
BASE PATH : /vmfs/volumes/100
DISK_TYPE : FILE
STATE : READY

DATASTORE CAPACITY
TOTAL: : 0M
FREE: : 0M
USED: : 0M
LIMIT: : -

PERMISSIONS
OWNER : um-
GROUP : u–
OTHER : —

DATASTORE TEMPLATE
BRIDGE_LIST="192.168.1.30"
CLONE_TARGET="SYSTEM"
DS_MAD="vmfs"
LN_TARGET="NONE"
TM_MAD="vmfs"
TYPE=“IMAGE_DS”

IMAGES
[root@one-sandbox ~]#

IMAGES
[root@one-sandbox ~]# onedatastore show 101
DATASTORE 101 INFORMATION
ID : 101
NAME : datastoredisk
USER : oneadmin
GROUP : oneadmin
CLUSTERS : 100
TYPE : IMAGE
DS_MAD : fs
TM_MAD : shared
BASE PATH : /vmfs/volumes/101
DISK_TYPE : FILE
STATE : READY

DATASTORE CAPACITY
TOTAL: : 9.1G
FREE: : 7.1G
USED: : 1.5G
LIMIT: : 19.5G

PERMISSIONS
OWNER : um-
GROUP : um-
OTHER : um-

DATASTORE TEMPLATE
CLONE_TARGET="SYSTEM"
DISK_TYPE="FILE"
DS_MAD="fs"
LIMIT_MB="20000"
LN_TARGET=“NONE"
RESTRICTED_DIRS=”/“
SAFE_DIRS=”/var/tmp"
TM_MAD="shared"
TYPE=“IMAGE_DS”

Hi Amit!,
could you post the following file /var/lib/one/remotes/vmm/vcenter/deploy '/var/lib/one/vms/3/deployment.0?

According to these lines:

Thu Nov 24 00:58:37 2016 [Z0][VMM]I: Successfully execute network driver operation: pre.
Thu Nov 24 00:58:37 2016 [Z0][VMM]I: Command execution fail: /var/lib/one/remotes/vmm/vcenter/deploy ‘/var/lib/one/vms/3/deployment.0’ ‘ESX-CLS’ 3 ESX-CLS
Thu Nov 24 00:58:37 2016 [Z0][VMM]I: Deploy of VM 3 on host ESX-CLS with /var/lib/one/vms/3/deployment.0 failed due to "Cannot clone VM Template: InvalidArgument: A specified parameter was not correct: "

Something is preventing the Clone VM operation to proceed, let’s if we can find the problem.

Cheers!