Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

heat boot from volume

I am trying to launch my instance from cinder volume with heat template, but no success. If I create a volume manually and then boot from it, everthing's OK.

Here's part of my heat template.

resources:
  Pilot:
    type: OS::Nova::Server
    depends_on: Pilot_Root_Disk
    metadata: { resource_facade: metadata }
    properties:
      name:
        str_replace:
          template: $system_name-$rcs
          params:
            $system_name: { get_param: system_name }
            $rcs: { get_param: rcs }
      availability_zone: { get_param: avail_zone }
      flavor: { get_param: flavor }
      networks: { get_param: [ network_list, Network-List ] }
      security_groups: { get_param: security_groups }
      block_device_mapping: [
        { delete_on_termination: true,
          device_name: vda,
          volume_id: { get_resource: Pilot_Root_Disk } }
      ]
      user_data_format: RAW
      user_data: { get_param: user_data }
      config_drive: "true"

  Pilot_Root_Disk:
    type: OS::Cinder::Volume
    properties:
      availability_zone: { get_param: avail_zone }
      size: 220
      image: { get_param: image }
      name:
        str_replace:
          template: $system_name-$rcs-vda
          params:
            $system_name: { get_param: system_name }
            $rcs: { get_param: rcs }

In scheduler.log, I saw:

compute-08 (node compute-08.local): [u'Traceback (most recent call last):\n', u'  File "/usr/lib/python2.6/site-packages/nova/compute/manager.py", line 1305, in _build_instance\n    set_access_ip=set_access_ip)\n', u'  File "/usr/lib/python2.6/site-packages/nova/compute/manager.py", line 393, in decorated_function\n    return function(self, context, *args, **kwargs)\n', u'  File "/usr/lib/python2.6/site-packages/nova/compute/manager.py", line 1717, in _spawn\n    LOG.exception(_(\'Instance failed to spawn\'), instance=instance)\n', u'  File "/usr/lib/python2.6/site-packages/nova/openstack/common/excutils.py", line 68, in __exit__\n    six.reraise(self.type_, self.value, self.tb)\n', u'  File "/usr/lib/python2.6/site-packages/nova/compute/manager.py", line 1714, in _spawn\n    block_device_info)\n', u'  File "/usr/lib/python2.6/site-packages/nova/virt/libvirt/driver.py", line 2265, in spawn\n    block_device_info)\n', u'  File "/usr/lib/python2.6/site-packages/nova/virt/libvirt/driver.py", line 3656, in _create_domain_and_network\n    power_on=power_on)\n', u'  File "/usr/lib/python2.6/site-packages/nova/virt/libvirt/driver.py", line 3559, in _create_domain\n    domain.XMLDesc(0))\n', u'  File "/usr/lib/python2.6/site-packages/nova/openstack/common/excutils.py", line 68, in __exit__\n    six.reraise(self.type_, self.value, self.tb)\n', u'  File "/usr/lib/python2.6/site-packages/nova/virt/libvirt/driver.py", line 3554, in _create_domain\n    domain.createWithFlags(launch_flags)\n', u'  File "/usr/lib/python2.6/site-packages/eventlet/tpool.py", line 179, in doit\n    result = proxy_call(self._autowrap, f, *args, **kwargs)\n', u'  File "/usr/lib/python2.6/site-packages/eventlet/tpool.py", line 139, in proxy_call\n    rv = execute(f,*args,**kwargs)\n', u'  File "/usr/lib/python2.6/site-packages/eventlet/tpool.py", line 77, in tworker\n    rv = meth(*args,**kwargs)\n', u'  File "/usr/lib64/python2.6/site-packages/libvirt.py", line 708, in createWithFlags\n    if ret == -1: raise libvirtError (\'virDomainCreateWithFlags() failed\', dom=self)\n', u"libvirtError: cannot open file '/var/lib/nova/instances/3310bf49-82d0-467d-8b9b-de8d453cdef8/disk': No such file or directory\n"]