XCP

Resize image is not supported for XCP brand

Bug #1016650 reported by msinhore
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
msinhore
XCP
New
Undecided
Unassigned

Bug Description

Selecting a flavor different of m1.tiny for an instance, this operation isn't supported when XCP is used. The XCP is related of XenServer described on table below:
XenServer 5.5 == XCP 0.5
XenServer 5.6 == XCP 1.0
XenServer 5.6sp2 == XCP 1.1
XenServer 6.0 == XCP 1.5

Based on this, the operation to resize the VHD is not supported as is showed in the backtrace below:

from 5GB to 20GB from (pid=1358) _resize_instance /usr/lib/python2.6/site-packages/nova/virt/xenapi/vmops.py:899
2012-06-21 16:14:50 ERROR nova.utils [req-f499f181-efc0-4ed1-abed-f3a5c644b5a7 afae889ca8c84479b8195e8b0e462320 faa2e7d479914529bfceda68c8ca33df] Instance eba99f3d-cf50-4f07-b75b-969922daa7b3: Failed to spawn, r
olling back.
2012-06-21 16:14:50 TRACE nova.utils Traceback (most recent call last):
2012-06-21 16:14:50 TRACE nova.utils File "/usr/lib/python2.6/site-packages/nova/virt/xenapi/vmops.py", line 346, in spawn
2012-06-21 16:14:50 TRACE nova.utils vdis = create_disks_step(undo_mgr)
2012-06-21 16:14:50 TRACE nova.utils File "/usr/lib/python2.6/site-packages/nova/virt/xenapi/vmops.py", line 138, in inner
2012-06-21 16:14:50 TRACE nova.utils rv = f(*args, **kwargs)
2012-06-21 16:14:50 TRACE nova.utils File "/usr/lib/python2.6/site-packages/nova/virt/xenapi/vmops.py", line 265, in create_disks_step
2012-06-21 16:14:50 TRACE nova.utils vdis = self._create_disks(context, instance, image_meta)
2012-06-21 16:14:50 TRACE nova.utils File "/usr/lib/python2.6/site-packages/nova/virt/xenapi/vmops.py", line 246, in _create_disks
2012-06-21 16:14:50 TRACE nova.utils self._resize_instance(instance, vdi["vdi_uuid"])
2012-06-21 16:14:50 TRACE nova.utils File "/usr/lib/python2.6/site-packages/nova/virt/xenapi/vmops.py", line 905, in _resize_instance
2012-06-21 16:14:50 TRACE nova.utils str(new_disk_size))
2012-06-21 16:14:50 TRACE nova.utils File "/usr/lib/python2.6/site-packages/nova/virt/xenapi_conn.py", line 574, in call_xenapi
2012-06-21 16:14:50 TRACE nova.utils return tpool.execute(f, *args)
2012-06-21 16:14:50 TRACE nova.utils File "/usr/lib/python2.6/site-packages/eventlet/tpool.py", line 76, in tworker
2012-06-21 16:14:50 TRACE nova.utils rv = meth(*args,**kwargs)
2012-06-21 16:14:50 TRACE nova.utils File "/usr/lib/python2.6/site-packages/XenAPI.py", line 229, in __call__
2012-06-21 16:14:50 TRACE nova.utils return self.__send(self.__name, args)
2012-06-21 16:14:50 TRACE nova.utils File "/usr/lib/python2.6/site-packages/XenAPI.py", line 133, in xenapi_request
2012-06-21 16:14:50 TRACE nova.utils result = _parse_result(getattr(self, methodname)(*full_params))
2012-06-21 16:14:50 TRACE nova.utils File "/usr/lib/python2.6/site-packages/XenAPI.py", line 203, in _parse_result
2012-06-21 16:14:50 TRACE nova.utils raise Failure(result['ErrorDescription'])
2012-06-21 16:14:50 TRACE nova.utils Failure: ['SR_OPERATION_NOT_SUPPORTED', 'OpaqueRef:81ae5ebc-399b-afbb-e406-057cbcdb0388']
2012-06-21 16:14:50 TRACE nova.utils
2012-06-21 16:14:50 ERROR nova.compute.manager [req-f499f181-efc0-4ed1-abed-f3a5c644b5a7 afae889ca8c84479b8195e8b0e462320 faa2e7d479914529bfceda68c8ca33df] [instance: eba99f3d-cf50-4f07-b75b-969922daa7b3] Instan
ce failed to spawn

Below the part of code mentioned in the backtrace:

        if virtual_size < new_disk_size:
            # Resize up. Simple VDI resize will do the trick
            LOG.debug(_("Resizing up VDI %(vdi_uuid)s from %(old_gb)dGB to "
                        "%(new_gb)dGB") % locals())
            if self._product_version[0] > 5:
                resize_func_name = 'VDI.resize'
            else:
         resize_func_name = 'VDI.resize_online'
            self._session.call_xenapi(resize_func_name, vdi_ref,
                    str(new_disk_size))
            LOG.debug(_("Resize instance %s complete") % (instance.uuid))

To fix this, is need to get the variable product_band and, since all XCP versions are larger than XenServer 5.x, add it to use only VDI.resize.

I attach a path for the Folsom.

Tags: xenserver xcp
Revision history for this message
msinhore (msinhore) wrote :
Revision history for this message
msinhore (msinhore) wrote :

The patch for essex is attached.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/8922

Changed in nova:
assignee: nobody → msinhore (msinhore)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/8931

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/8967

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/8969

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/8987

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/9001

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/9010

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/9012

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/9016

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/9071

msinhore (msinhore)
description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/9184

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/9184
Committed: http://github.com/openstack/nova/commit/9a2cc2544a4e6609c409b06c8ff91d596fe43a8c
Submitter: Jenkins
Branch: master

commit 9a2cc2544a4e6609c409b06c8ff91d596fe43a8c
Author: Marco Sinhoreli <email address hidden>
Date: Mon Jul 23 15:24:59 2012 -0300

    Adds xcp disk resize support.

    Implements resize image during instance creation. Fixes bug 1016650.

    Change-Id: I25f9d1030d9d014b1c9a65430bd535388b8f8943

Changed in nova:
status: In Progress → Fix Committed
Revision history for this message
Mate Lakat (mate-lakat) wrote :

msinhore: Could you recall what was the type of the sr that you were using?

xe sr-param-get uuid=<uuid> param-name=type

Revision history for this message
msinhore (msinhore) wrote :

Mate: I was using a sr type ext.

Thierry Carrez (ttx)
Changed in nova:
milestone: none → folsom-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: folsom-3 → 2012.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.