Unable to import vCenter datastore as image datastore in 5.4 beta


vCenter - 6.0
Opennebula - 5.4 Beta

When I import vcenter datastore from sunstone all the datastore - local and nfs are imported as system datastore in Sunstone.

How do I import nfs datastore as image datastore from Sunstone or command line?

Kiran Ranjane

Hi Kiran,
thanks for your feedback.

The import process should discover the datastores and for each of them it should create two datastore representations, one as an IMAGE and the other one as a SYSTEM (with the StorageDRS cluster exception that can only be represented as a SYSTEM datastore).

If OpenNebula hasn’t created the IMAGE datastore it could be due to two reasons:

  • The IMAGE datastore could have already been imported in a previous import. In that case the import tool detects it and would only create the SYSTEM datastore.
  • The import tool believes that the IMAGE datastore has already been created due to a bug in the code and then it refuses to create the IMAGE datastore.

As what you describe it may be a bug in the code, could you provide the following information if you’re so kind?

onedatastore list -x

That command will output the XML templates for your datastores so we can review them and guess what can be wrong. Before uploading the file with that output, you may check if there’s sensitive information that you don’t want to share in datastore names used.

We appreciate your feedback and help,


I have attached text file with the output.

Kiran Ranjane

one54-beta.txt (9.6 KB)

Thanks Kiran,
with the help of the file you’ve uploaded I’ve been trying to reproduce the problem but so far I could not reproduce your issue :frowning:

If you’re so kind could you answer me some questions?

  • When you try to import a datastore and the SYSTEM datastore is created, does OpenNebula show any error in the CLI or in Sunstone e.g the IMAGE datastore cannot be created?
  • Have you tried to import the datastore both in Sunstone or in the CLI? If you haven’t used the CLI could you remove one of the SYSTEM datastore before trying to import the datastore from the CLI? You can import datastores from the CLI executing the following command as oneadmin:
    onevcenter datastores --vcenter $HOST --vuser $USER
    replacing $HOST with your vcenter host or IP and $USER with the vcenter user account.
  • Could you post the output of the previous command if you try to import a datastore again?

Finally it would help us a lot if you tried to do the following:

  • Open the Sunstone interface.
  • Remove one of the SYSTEM datastores
  • If you use Chrome or Firefox open the Development Tools with Ctrl + Shift + I
  • With the development tools opened try to get the Datastores, not importing them just get the list of available datastores.
  • Click on the Network tab of the Development Tools

  • Browse the requests found in the Network tab and look for a query that starts or contains datastores, it probably would be the last request.

  • Click on the URL with datastores, a new subwindow will open containing the answer provided by OpenNebula when a list of datastores is requested.

  • Could you upload the text found between the starting and ending curly braces?, that’s the JSON answer that may give us more info to debug this issue.

Once again thanks for your time and feedback, it’s extremely valuable to us.


Here’s the output

Connecting to vCenter:…done!

Looking for Datastores…done!

Do you want to process datacenter DC-Central-Europe (y/[n])? y

  • Datastore found:

    • Name : [ - DC-Central-Europe] Primary - Cluster-Strasbourg
    • Total MB : 12793939
    • Free MB : 12516073
    • Cluster : Cluster-Strasbourg
      Import this as Datastore [y/n]? y

    NOTE: For each vcenter datastore a SYSTEM and IMAGE datastore
    will be created in OpenNebula except for a StorageDRS which is
    represented as a SYSTEM datastore only.

    Error creating datastore: [one.datastore.allocate] Datastore template is missing the “VCENTER_CLUSTER” attribute or it’s empty.

    OpenNebula datastore 125 created!

{“DC-Central-Europe”:[{“name”:"[ - DC-Central-Europe] Primary - Cluster-Strasbourg",“total_mb”:12793939,“free_mb”:12516073,“cluster”:“Cluster-Strasbourg”,“ds”:[{“one”:“NAME=”[ - DC-Central-Europe] Primary - Cluster-Strasbourg (IMG)"\nTM_MAD=vcenter\nVCENTER_INSTANCE_ID=“b2787ec6-d35f-4cc0-a97a-7c654573c2f0”\nVCENTER_CCR_REF=“domain-c7”\nVCENTER_DS_REF=“datastore-61”\nVCENTER_ONE_HOST_ID=“0”\nDS_MAD=vcenter\nTYPE=IMAGE_DS\n"}]},{“name”:"[ - DC-Central-Europe] Secondary - Cluster-Strasbourg",“total_mb”:12793939,“free_mb”:12516073,“cluster”:“Cluster-Strasbourg”,“ds”:[{“one”:“NAME=”[ - DC-Central-Europe] Secondary - Cluster-Strasbourg (IMG)"\nTM_MAD=vcenter\nVCENTER_INSTANCE_ID=“b2787ec6-d35f-4cc0-a97a-7c654573c2f0”\nVCENTER_CCR_REF=“domain-c7”\nVCENTER_DS_REF=“datastore-81”\nVCENTER_ONE_HOST_ID=“0”\nDS_MAD=vcenter\nTYPE=IMAGE_DS\n"},{“one”:“NAME=”[ - DC-Central-Europe] Secondary - Cluster-Strasbourg (SYS)"\nTM_MAD=vcenter\nVCENTER_INSTANCE_ID=“b2787ec6-d35f-4cc0-a97a-7c654573c2f0”\nVCENTER_CCR_REF=“domain-c7”\nVCENTER_DS_REF=“datastore-81”\nVCENTER_ONE_HOST_ID=“0”\nTYPE=SYSTEM_DS\n"}]},{“name”:"[ - DC-Central-Europe] datastore1-1 - Cluster-Strasbourg",“total_mb”:106752,“free_mb”:94577,“cluster”:“Cluster-Strasbourg”,“ds”:[{“one”:“NAME=”[ - DC-Central-Europe] datastore1-1 - Cluster-Strasbourg (IMG)"\nTM_MAD=vcenter\nVCENTER_INSTANCE_ID=“b2787ec6-d35f-4cc0-a97a-7c654573c2f0”\nVCENTER_CCR_REF=“domain-c7”\nVCENTER_DS_REF=“datastore-18”\nVCENTER_ONE_HOST_ID=“0”\nDS_MAD=vcenter\nTYPE=IMAGE_DS\n"},{“one”:“NAME=”[ - DC-Central-Europe] datastore1-1 - Cluster-Strasbourg (SYS)"\nTM_MAD=vcenter\nVCENTER_INSTANCE_ID=“b2787ec6-d35f-4cc0-a97a-7c654573c2f0”\nVCENTER_CCR_REF=“domain-c7”\nVCENTER_DS_REF=“datastore-18”\nVCENTER_ONE_HOST_ID=“0”\nTYPE=SYSTEM_DS\n"}]},{“name”:"[ - DC-Central-Europe] datastore1 - Cluster-Strasbourg",“total_mb”:106752,“free_mb”:73876,“cluster”:“Cluster-Strasbourg”,“ds”:[{“one”:“NAME=”[ - DC-Central-Europe] datastore1 - Cluster-Strasbourg (IMG)"\nTM_MAD=vcenter\nVCENTER_INSTANCE_ID=“b2787ec6-d35f-4cc0-a97a-7c654573c2f0”\nVCENTER_CCR_REF=“domain-c7”\nVCENTER_DS_REF=“datastore-12”\nVCENTER_ONE_HOST_ID=“0”\nDS_MAD=vcenter\nTYPE=IMAGE_DS\n"},{“one”:“NAME=”[ - DC-Central-Europe] datastore1 - Cluster-Strasbourg (SYS)"\nTM_MAD=vcenter\nVCENTER_INSTANCE_ID=“b2787ec6-d35f-4cc0-a97a-7c654573c2f0”\nVCENTER_CCR_REF=“domain-c7”\nVCENTER_DS_REF=“datastore-12”\nVCENTER_ONE_HOST_ID=“0”\nTYPE=SYSTEM_DS\n"}]}]}

Thanks a lot Kiran for your feedback,
now I understand what the issue is. In /etc/one/oned.conf configuration file you have this:


The VCENTER_CLUSTER attribute is no longer required when creating a datastore, so if you set REQUIRED_ATTRS="" and restart the OpenNebula service to apply the changes you could try to import those datastores again and this time the IMAGE datastores should be created.

As any other issues may occur when you do your tests with a configuration file, you may have to take a look at the updated oned.conf file here for inherited and required attributes.

Hope it solves the issue and thanks again thank you for your time,


Thanks, changed to REQUIRED_ATTRS = “” and that fixed it. Now datastores are imported as img.

Kiran Ranjane

Excellent news,
thanks again for your time and feedback.