[SOLVED] Add balnk image to VM

Hello!

I heve VMWare cluster with Opennebula. I need add blank image to VM. I go to Images adm try create DATABLOCK image and get error:
> Fri Jan 6 22:48:53 2017 [Z0][ImM][I]: Command execution fail: /var/lib/one/remotes/datastore/vcenter/monitor PERTX0RSSVZFUl9BQ1RJT05fREFUQT48REFUQVNUT1JFPjxJRD4xMDA8L0lEPjxVSUQ+MDwvVUlEPjxHSUQ+MDwvR0lEPjxVTkFNRT5vbmVhZG1pbjwvVU5BTUU+PEdOQU1FPm9uZWFkbWluPC9HTkFNRT48TkFNRT5TQU4yPC9OQU1FPjx

    QRVJNSVNTSU9OUz48T1dORVJfVT4xPC9PV05FUl9VPjxPV05FUl9NPjE8L09XTkVSX00+PE9XTkVSX0E+MDwvT1dORVJfQT48R1JPVVBfVT4xPC9HUk9VUF9VPjxHUk9VUF9NPjA8L0dST1VQX00+PEdST1VQX0E+MDwvR1JPVVBfQT48T1RIRVJfVT4wPC9PVEhFUl9VPjxPVEhFUl9NPjA8L09USEVSX00+PE9USEVSX0E+MDwvT1RIRVJfQT48L1BFUk1JU1NJT05TPjxEU19NQUQ+PCFb
    Q0RBVEFbdmNlbnRlcl1dPjwvRFNfTUFEPjxUTV9NQUQ+PCFbQ0RBVEFbdmNlbnRlcl1dPjwvVE1fTUFEPjxCQVNFX1BBVEg+PCFbQ0RBVEFbL3Zhci9saWIvb25lLy9kYXRhc3RvcmVzLzEwMF1dPjwvQkFTRV9QQVRIPjxUWVBFPjA8L1RZUEU+PERJU0tfVFlQRT4wPC9ESVNLX1RZUEU+PFNUQVRFPjA8L1NUQVRFPjxDTFVTVEVSUz48SUQ+MDwvSUQ+PC9DTFVTVEVSUz48VE9UQUxfT
    UI+NDA5MzQ0PC9UT1RBTF9NQj48RlJFRV9NQj4yOTEwMzQ8L0ZSRUVfTUI+PFVTRURfTUI+MTE4MzEwPC9VU0VEX01CPjxJTUFHRVM+PC9JTUFHRVM+PFRFTVBMQVRFPjxDTE9ORV9UQVJHRVQ+PCFbQ0RBVEFbTk9ORV1dPjwvQ0xPTkVfVEFSR0VUPjxESVNLX1RZUEU+PCFbQ0RBVEFbRklMRV1dPjwvRElTS19UWVBFPjxEU19NQUQ+PCFbQ0RBVEFbdmNlbnRlcl1dPjwvRFNfTUFEPj
    xMTl9UQVJHRVQ+PCFbQ0RBVEFbTk9ORV1dPjwvTE5fVEFSR0VUPjxSRVNUUklDVEVEX0RJUlM+PCFbQ0RBVEFbL11dPjwvUkVTVFJJQ1RFRF9ESVJTPjxTQUZFX0RJUlM+PCFbQ0RBVEFbL3Zhci90bXBdXT48L1NBRkVfRElSUz48VE1fTUFEPjwhW0NEQVRBW3ZjZW50ZXJdXT48L1RNX01BRD48VkNFTlRFUl9DTFVTVEVSPjwhW0NEQVRBW0Nsb3VkXV0+PC9WQ0VOVEVSX0NMVVNURVI
    +PC9URU1QTEFURT48L0RBVEFTVE9SRT48L0RTX0RSSVZFUl9BQ1RJT05fREFUQT4= 100
    Fri Jan  6 22:48:53 2017 [Z0][ImM][I]: Error monitoring SAN2. Reason: undefined method `id' for nil:NilClass
    Fri Jan  6 22:48:53 2017 [Z0][ImM][I]: ExitCode: 255
    Fri Jan  6 22:48:53 2017 [Z0][ImM][E]: Error monitoring datastore 100: LQ==. Decoded info: -
    Fri Jan  6 22:48:53 2017 [Z0][ImM][I]: Command execution fail: /var/lib/one/remotes/datastore/vcenter/monitor PERTX0RSSVZFUl9BQ1RJT05fREFUQT48REFUQVNUT1JFPjxJRD4xMDE8L0lEPjxVSUQ+MDwvVUlEPjxHSUQ+MDwvR0lEPjxVTkFNRT5vbmVhZG1pbjwvVU5BTUU+PEdOQU1FPm9uZWFkbWluPC9HTkFNRT48TkFNRT5TQU48L05BTUU+PFB
    FUk1JU1NJT05TPjxPV05FUl9VPjE8L09XTkVSX1U+PE9XTkVSX00+MTwvT1dORVJfTT48T1dORVJfQT4wPC9PV05FUl9BPjxHUk9VUF9VPjE8L0dST1VQX1U+PEdST1VQX00+MDwvR1JPVVBf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RBVEFTVE9SRT48L0RTX0RSSVZFUl9BQ1RJT05fREFUQT4= 101
    Fri Jan  6 22:48:53 2017 [Z0][ImM][I]: Error monitoring SAN. Reason: undefined method `id' for nil:NilClass
    Fri Jan  6 22:48:53 2017 [Z0][ImM][I]: ExitCode: 255
    Fri Jan  6 22:48:53 2017 [Z0][ImM][E]: Error monitoring datastore 101: LQ==. Decoded info: -

How I can add images to VMs without problems?
Thanks!

P.S. Sorry for my English!

Hi Anton!
when creating an empty/blank image in vCenter, could you try to define both the Disk provisioning type, and the Bus adapter controller type under Advanced Options?

It could be related to this ticket, some defaults should be possible to be defined so for example when creating an empty datastore the provisioning type and bus adapter would get that defaults so the image creation doesn’t fail. Let’s see if that solves your issue.

Cheers!

Hello!
Yes, I try all variants…

Hi Anton!
in OpenNebula 5.2, I confirm that the image is created (state shows READY) if selecting for example: thin for disk provisioning and lsiLogic for bus adapter type:

Empty datablock shows READY status:

Cheers!

I’m doing the same thing and Empty datablock shows ERROR status and error in log.

If I don’t set disk provisioning and adapter controller the following error is shown: Not enough information to create the image, so could you try to find and post the error message for the datablock creation failure? try to search for “Command execution fail: /var/lib/one/remotes/datastore/vcenter/mkfs”? in /var/log/one/oned.log. Let’s see what it’s happening.

Cheers!

Try create on second datastore and get same error.

Mon Jan 9 11:30:10 2017 [Z0][ImM][I]: Command execution fail: /var/lib/one/remotes/datastore/vcenter/mkfs PERTX0RSSVZFUl9BQ1RJT05fREFUQT48SU1BR0U+PElEPjEwPC9JRD48VUlEPjA8L1VJRD48R0lEPjA8L0dJRD48VU5BTUU+b25lYWRtaW48L1VOQU1FPjxHTkFNRT5vbmVhZG1pbjwvR05BTUU+PE5BTUU+dGVzdDI8L05BTUU+PFBFUk1JU1
NJT05TPjxPV05FUl9VPjE8L09XTkVSX1U+PE9XTkVSX00+MTwvT1dORVJfTT48T1dORVJfQT4wPC9PV05FUl9BPjxHUk9VUF9VPjA8L0dST1VQX1U+PEdST1VQX00+MDwvR1JPVVBfTT48R1JPV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hW0NEQVRBWy92YXIvdG1wXV0+PC
9TQUZFX0RJUlM+PFRNX01BRD48IVtDREFUQVt2Y2VudGVyXV0+PC9UTV9NQUQ+PFZDRU5URVJfQ0xVU1RFUj48IVtDREFUQVtDbG91ZF1dPjwvVkNFTlRFUl9DTFVTVEVSPjwvVEVNUExBVEU+PC9EQVRBU1RPUkU+PC9EU19EUklWRVJfQUNUSU9OX0RBVEE+ 10
Mon Jan 9 11:30:10 2017 [Z0][ImM][I]: Error creating virtual disk in SAN2. Reason: undefined method `id’ for nil:NilClass
Mon Jan 9 11:30:10 2017 [Z0][ImM][I]: ExitCode: 255
Mon Jan 9 11:30:10 2017 [Z0][ImM][E]: Error creating datablock
Mon Jan 9 11:30:10 2017 [Z0][InM][D]: Monitoring datastore SAN2 (100)
Mon Jan 9 11:30:10 2017 [Z0][ReM][D]: Req:4896 UID:0 HostPoolInfo invoked
Mon Jan 9 11:30:10 2017 [Z0][ReM][D]: Req:4896 UID:0 HostPoolInfo result SUCCESS, "<HOST_POOL><ID…"
Mon Jan 9 11:30:10 2017 [Z0][ImM][I]: Command execution fail: /var/lib/one/remotes/datastore/vcenter/monitor PERTX0RSSVZFUl9BQ1RJT05fREFUQT48REFUQVNUT1JFPjxJRD4xMDA8L0lEPjxVSUQ+MDwvVUlEPjxHSUQ+MDwvR0lEPjxVTkFNRT5vbmVhZG1pbjwvVU5BTUU+PEdOQU1FPm9uZWFkbWluPC9HTkFNRT48TkFNRT5TQU4yPC9OQU1FPjx
QRVJNSVNTSU9OUz48T1dORVJfVT4xPC9PV05FUl9VPjxPV05FUl9NPjE8L09XTkVSX00+PE9XTkVSX0E+MDwvT1dORVJfQT48R1JPVVBfVT4xPC9HUk9VUF9VPjxHUk9VUF9NPjA8L0dST1VQX00+PEdST1VQX0E+MDwvR1JPVVBfQT48T1RIRVJfVT4wPC9PVEhFUl9VPjxPVEhFUl9NPjA8L09USEVSX00+PE9USEVSX0E+MDwvT1RIRVJfQT48L1BFUk1JU1NJT05TPjxEU19NQUQ+PCFb
Q0RBVEFbdmNlbnRlcl1dPjwvRFNfTUFEPjxUTV9NQUQ+PCFbQ0RBVEFbdmNlbnRlcl1dPjwvVE1fTUFEPjxCQVNFX1BBVEg+PCFbQ0RBVEFbL3Zhci9saWIvb25lLy9kYXRhc3RvcmVzLzEwMF1dPjwvQkFTRV9QQVRIPjxUWVBFPjA8L1RZUEU+PERJU0tfVFlQRT4wPC9ESVNLX1RZUEU+PFNUQVRFPjA8L1NUQVRFPjxDTFVTVEVSUz48SUQ+MDwvSUQ+PC9DTFVTVEVSUz48VE9UQUxfT
UI+NDA5MzQ0PC9UT1RBTF9NQj48RlJFRV9NQj4yOTEwMzQ8L0ZSRUVfTUI+PFVTRURfTUI+MTE4MzEwPC9VU0VEX01CPjxJTUFHRVM+PElEPjEwPC9JRD48L0lNQUdFUz48VEVNUExBVEU+PENMT05FX1RBUkdFVD48IVtDREFUQVtOT05FXV0+PC9DTE9ORV9UQVJHRVQ+PERJU0tfVFlQRT48IVtDREFUQVtGSUxFXV0+PC9ESVNLX1RZUEU+PERTX01BRD48IVtDREFUQVt2Y2VudGVyXV
0+PC9EU19NQUQ+PExOX1RBUkdFVD48IVtDREFUQVtOT05FXV0+PC9MTl9UQVJHRVQ+PFJFU1RSSUNURURfRElSUz48IVtDREFUQVsvXV0+PC9SRVNUUklDVEVEX0RJUlM+PFNBRkVfRElSUz48IVtDREFUQVsvdmFyL3RtcF1dPjwvU0FGRV9ESVJTPjxUTV9NQUQ+PCFbQ0RBVEFbdmNlbnRlcl1dPjwvVE1fTUFEPjxWQ0VOVEVSX0NMVVNURVI+PCFbQ0RBVEFbQ2xvdWRdXT48L1ZDRU5
URVJfQ0xVU1RFUj48L1RFTVBMQVRFPjwvREFUQVNUT1JFPjwvRFNfRFJJVkVSX0FDVElPTl9EQVRBPg== 100

Hi Anton!
I’ve been reviewing your outputs and according to your logs there are two issues:

  • The datastore SAN and SAN2 can’t be monitored. The reason is an exception: Error monitoring SAN2. Reason: undefined method ‘id’ for nil:NilClass and Error monitoring SAN. Reason: undefined method `id’ for nil:NilClass
  • The datablock can’t be created and the reason looks the same exception: Error creating virtual disk in SAN2. Reason: undefined method `id’ for nil:NilClass

I’ve been following the code and I think that the issue would be caused by one of the following two situations:

Possible situation #1. If you run the onedatastore show 100 -x | grep VCENTER_CLUSTER and onedatastore show 101 -x | grep VCENTER_CLUSTER you should get the name of the vCenter cluster associated to those datastores (Datastore SAN has the ID 100 while Datastore SAN2 has the ID 101 according to your logs).

Do you get any output from those commands? If you get no output, then the issue is that OpenNebula does not have a cluster name associated with the datastores and it needs one to get the vCenter connection info like host, user and password (it fails trying to get the id attribute for a nil / not found cluster).

Possible situation #2. If you get the cluster name from the previous command you should now run the onehost list command. You should get a list of the vCenter clusters managed by OpenNebula. If you can’t find the cluster name in that list then that would be the issue, OpenNebula tries to get the id attribute of a not found cluster.

The solution for issue number 1. I guess you could try to add a VCENTER_CLUSTER=cluster_name where cluster_name is the name of an ESX cluster that knows how to connect to datastores SAN and SAN2. that cluster_name should be listed if you run a onehost list.

The solution for issue number 2. I guess you could try to import a cluster with access to datastore SAN and SAN2 using the onevcenter host command or the Import button in Sunstone.

In any case please proceed with caution!, and let me know if any of the possible situations that I’ve presented here may explain the issue.

Cheers!

P.S: Sorry for this long long answer

1 Like

Hello Miguel!

Thank you very much for your answer! My datastores lose VCENTER_CLUSTER name. Your fist solution resolve problem!

Thanks!

P.S. Sorry for my English.