Wednesday 16 November 2011

How to add vmware and VirtualBox image in openstack

VMware

Vmware will create vm with disk image *.vmdk , first locate the file (you can do this by selecting the setting of corresponding vm and select "Hard Disk(scsi) or usualy it will be in "Virtual Machine" folder created during vmware installation)
Then copy the file in to your openstack cloud system (you can use scp for this).

glance add -A <admin_password> name="<image name>" is_public=true container_format=bare disk_format=vmdk < myvm.vmdk

NOTE : change
<admin_password> = your glance admin password
<image name>         =  name of image , this name will be shown  in your dashboard after you upload
 myvm.vmdk            = your virtual machine name .vmdk(the file which you coppied)



Another method you may think of is using ova and ovf which you can create by using vmware export option . But you can not add .ova file in your openstack cloud since it is not support by glance. And you can not add *.ovf which is created by vmware because current vmwareapi driver of nova supports only thick flat vmdk disk so you can only add *.vmdk file

(I conformed by asking it in openstack group at launchpad.net  https://answers.launchpad.net/glance/+question/178944 )

VirtualBox

  In case of VirtualBox it create vm with disk image *.vdi as default. Locate it and copy to your openstack cloud system

glance add -A <admin_password> name="<image name>" is_public=true container_format=bare disk_formate=vdi < myvm.vdi

NOTE : change
<admin_password> - your glance admin password
<image name>         -  name of image , this name will be shown  your dashboard after you apploaded
myvm.vdi                 -  your virtual machine name .vmdk(the file which you coppied)



Thank you all..








6 comments:

  1. This comment has been removed by the author.

    ReplyDelete
    Replies
    1. Hi Raúl
      sorry for very late reply...

      Here is ur msg..
      ----------------------------------------------
      I'm getting this error after 1 minuto without any clues in the log:

      Failed to add image. Got error:
      Unexpected response: 500
      Note: Your image metadata may still be in the registry, but the image's status will likely be 'killed'.

      Which are the requirements for the virtualbox image? In my case it's a debian host with two partitions and is using lvm

      ---------------------------------------------------
      If your error is not yet solved ..
      pl z try this command and write the reply

      1)
      $ euca-describe-images
      2)
      and pl z paste the last few lines of glance log file to get more details about the error..

      I have mentioned the format which I personally used to upload virtualbox image...

      Thank you

      Delete
  2. This comment has been removed by the author.

    ReplyDelete
  3. Hi Ashokkuma,

    I tried to follow your instructions and ran into a couple of issues so I decided to post my results here for the benefit of other; especially, since you were first hit in all of my google searches.

    The first thing is that -A is deprecated and it didn't work for me, so one thing that people can try is the following:

    1. Create the following environment variables:
    export OS_USERNAME=admin (in my case this was not my OS user root. this was actually the user for logging into the openstack site)
    export OS_PASSWORD=my key or pass
    export OS_AUTH_KEY=my key or pass
    export OS_TENANT_NAME=admin (same as user or project name)
    export OS_AUTH_URL=http://localhost:5000/v2.0/
    export KEYSTONE_VERSION=2.0

    2. There's a typo in your instructions disk_formate=vdi should be disk_format=vdi (removing the e after formate => format).

    3. Run the following command: glance add name="My Virtual Machine's Name" is_public=true container_format=bare disk_formate=vmdk < myVirtualMachine.vmdk

    Hope this helps someone.

    Good luck!

    ReplyDelete
  4. Dear Unknown,

    Thank you for your comment, I hope It will help someone...

    you have mentioned that -A is not working for you, I strongly believe that you are using the latest version (i.e not less then Essex release or master branch). Because when I tried this for the first time i.e last year (Nov 2011), Diablo release was the stable one, And I have used the same command which I posted here and it worked fine.

    and sorry for typo error, I made the changes ..Thanks

    I am Happy that my experience actually helped someone in some way..

    ReplyDelete
  5. There is a tool to simplify an OpenStack migration and solve portability issues.

    Please see:

    http://cloudscraper.migrate2iaas.com/openstack_convert

    ReplyDelete