Openstack image upload best practices
search cancel

Openstack image upload best practices

book

Article ID: 321755

calendar_today

Updated On: 07-17-2024

Products

VMware Integrated OpenStack

Issue/Introduction

When uploading image to glance through horizon/CLI, it may timeout before completion due to the size of the image or transfer speed.  

If the image import is done through the Horizon UI,
  1. The image will first upload to horizon temp folder,
  2. The image will be transferred to glance-api working folder,
    1. Conversion of the image would be done if needed
    2. Upload to the glance datastore (by default NFC is used)
Note:  The horizon session timeout is 1 hour.  If the operation can not complete within 1 hour, the session will be terminated, halting the image upload process.

If the image import is done through the CLI,
  1. The image will upload to the glance-api working folder,
    1. Conversion of the image would be done if needed,
    2. Upload to the glance datastore (by default NFC is used)
Note:  The

image_transfer_timeout default value is 7200s.  If the operation can not complete within 2 hours, the session will be terminated, halting the image upload process.

Environment

7.x

Resolution

To help speed up the process:

  • Pre-convert the image to VMDK to save time on import.   (qemu-img for example)
  • Use CLI commands to remove the extra step of upload to horizon tmp folder.
  • Pass property value vmware_vcenter_upload=true while uploading image to disable NFC upload.
For example
# openstack --insecure image create ‘ubuntu’ --disk-format vmdk --file /root/ess/xenial-server-cloudimg-amd64-disk1.vmdk --property vmware_vcenter_upload=true --container-format bare --public
 

For large images, check the size of the root disk on the controllers.  You would need at least 2x the image size in space available.  To increase the size of the controllers disk, follow Extending root disk of VIO controllers

Large images:

Large images may need a different timeout in order to complete.  The openstack CLI doesn't provide an option for that.  We need to switch to the glance CLI.  

For example

glance --insecure --timeout 28800 image-create <additional options>

See glance cli documentation for additional options per your needs.