VMware Cloud Community
hamidn
Contributor
Contributor

Create volumes on VMware datastore

Hi,

I have followed the vova documentation and deployed openstack in a testing environment.

I have created ubuntu images and using that I can launch new instances which seems to be working well. After launching the instance, I can see a folder with their id on the datastore which is defined in vcenter.

But when I create a new volume in openstack, I cannot see anything on the datastore or in the cinder-volumes?! I wonder if the creation of a volume without an instance is being done on the local disk of the vova vm? Also attaching a volume to an existing instance seems not doing anything.

Is there anyway to make sure where a volume has been created? and how can I make it to create the volume on the defined datastore which is being used for vm objects?

Thanks in advance.

6 Replies
admin
Immortal
Immortal

Hi hamidn,

When a volume is created in cinder, the backing shadow VM for the volume (in most cases) is not created until the volume is attached to an instance in the OpenStack side. So the behavior you reported where you do not see anything in the datastore or cinder-volumes, is expected. Once you attach the volume to an instance, you should see in your VM inventory a VM named 'volume-<uuid>', where uuid will be the uuid of the volume in cinder. This VM will not have any disk, the shadow VM is like a place holder for the disk when it is detached at a later point from the instance. The actual disk will be attached to the instance to which the volume was attached in OpenStack.

To your second point, when you mention "Also attaching a volume to an existing instance seems not doing anything", do you mean you don't see anything on the vCenter side or you don't see the volume inside the instance. Just to make sure, once the volume you attached, it may have to be formatted and mounted within the instance's guest operating system.

hamidn
Contributor
Contributor

Hi,

Thank you for your reply.

About attaching a volume, I created a screencast that I'm attaching to this post.

What I check to see if the volume has been attached or not is the below conditions:

     1. The web interface GUI shows no attachment for the volume.

     2. The "cinder list" command returns the volumes with the "attached to" field being empty.

     3. When I login to the nova instance, the command "fdisk -l" is not showing the device that I used in the "volume-attach" command.

and the problem is that even the command returns a "0" status which I assume it means the operation has been done successfully. (Not sure if it is the right way to check the result of my command?)

Thank you again for your time.

0 Kudos
v_bala
VMware Employee
VMware Employee

This happens when there is a problem creating the shadow VM in vCenter. Please check cinder-volume log to identify the exact reason. If attach fails, the volume state should transition to "error_attaching" and this is a known issue.

hamidn
Contributor
Contributor

Well the problem solved.

It was my fault, I was trying to attach a volume to a running instance. It seems that I need to shutdown the instance before attaching a volume to it.

Thanks for your replies.

0 Kudos
v_bala
VMware Employee
VMware Employee

If the instance's disk adapter type is not IDE, then it is possible to attach volume to a running instance. With the following patch, you should be able to attach volume to a running instance even if its adapter type is IDE.

https://review.openstack.org/#/c/122251/

kanthiv
Contributor
Contributor

With a shadow VM in place, both Parent VM and Shadow VM has their vmx files which have location of the VMDK pointing to the "volume_<UUID" folder.  Now., for the backup application is there anyway to identify the shadow VM and ignore that for backup?.  Otherwise, lock out problem happens on the VMDK whose snapshot will be triggered by VDDK, twice.

I am looking for some meta data infomration which can be queried on the VM which will indicate that it is shadow VM and while restoring, the shadow VM has to get created though... Any ideas here?

0 Kudos