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

**URL:** https://forum.opennebula.io/t/allocated-cpu-and-memory-showing-0-after-adding-vcenter-in-opennebula/3316
**Category:** Product Support
**Created:** [November 20, 2016, 11:03am UTC](https://forum.opennebula.io/t/allocated-cpu-and-memory-showing-0-after-adding-vcenter-in-opennebula/3316 "2016-11-20T11:03:56Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Amit\_Kumar](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/amit_kumar/32/7867_2.png) [@Amit\_Kumar](https://forum.opennebula.io/u/Amit_Kumar)
#### Post date: [November 20, 2016, 11:03am UTC](https://forum.opennebula.io/t/allocated-cpu-and-memory-showing-0-after-adding-vcenter-in-opennebula/3316/1 "2016-11-20T11:03:56Z")

</div>

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…

---

<div class="post-metadata">

### Author: ![mcabrerizo](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/mcabrerizo/32/4829_2.png) [@mcabrerizo](https://forum.opennebula.io/u/mcabrerizo)
#### Post date: [November 21, 2016, 3:55pm UTC](https://forum.opennebula.io/t/allocated-cpu-and-memory-showing-0-after-adding-vcenter-in-opennebula/3316/2 "2016-11-21T15:55:45Z")

</div>

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](http://docs.opennebula.org/5.0/deployment/vmware_infrastructure_setup/datastore_setup.html?highlight=vcenter) about vcenter datastores so you can view the process and check the current limitations with vcenter datastores.

Cheers!

---

<div class="post-metadata">

### Author: ![Amit\_Kumar](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/amit_kumar/32/7867_2.png) [@Amit\_Kumar](https://forum.opennebula.io/u/Amit_Kumar)
#### Post date: [November 21, 2016, 8:59pm UTC](https://forum.opennebula.io/t/allocated-cpu-and-memory-showing-0-after-adding-vcenter-in-opennebula/3316/3 "2016-11-21T20:59:07Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![Amit\_Kumar](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/amit_kumar/32/7867_2.png) [@Amit\_Kumar](https://forum.opennebula.io/u/Amit_Kumar)
#### Post date: [November 21, 2016, 9:00pm UTC](https://forum.opennebula.io/t/allocated-cpu-and-memory-showing-0-after-adding-vcenter-in-opennebula/3316/4 "2016-11-21T21:00:51Z")

</div>

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

---

<div class="post-metadata">

### Author: ![mcabrerizo](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/mcabrerizo/32/4829_2.png) [@mcabrerizo](https://forum.opennebula.io/u/mcabrerizo)
#### Post date: [November 23, 2016, 9:02am UTC](https://forum.opennebula.io/t/allocated-cpu-and-memory-showing-0-after-adding-vcenter-in-opennebula/3316/5 "2016-11-23T09:02:45Z")

</div>

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.](http://docs.opennebula.org/5.2/operation/vm_management/vcenter_specifics.html?highlight=vcenter#vcenter-vm-and-vm-templates)

Cheers!

---

<div class="post-metadata">

### Author: ![Amit\_Kumar](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/amit_kumar/32/7867_2.png) [@Amit\_Kumar](https://forum.opennebula.io/u/Amit_Kumar)
#### Post date: [November 24, 2016, 1:15am UTC](https://forum.opennebula.io/t/allocated-cpu-and-memory-showing-0-after-adding-vcenter-in-opennebula/3316/6 "2016-11-24T01:15:55Z")

</div>

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”

---

<div class="post-metadata">

### Author: ![mcabrerizo](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/mcabrerizo/32/4829_2.png) [@mcabrerizo](https://forum.opennebula.io/u/mcabrerizo)
#### Post date: [November 25, 2016, 1:38pm UTC](https://forum.opennebula.io/t/allocated-cpu-and-memory-showing-0-after-adding-vcenter-in-opennebula/3316/7 "2016-11-25T13:38:51Z")

</div>

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!
