Hi,
I want to build a centos6 image for baremetal deployment, but found it failed when installing boot loader.
# generate image
disk-image-create dynamic-login centos baremetal dhcp-all-interfaces grub2 -o centos6.qcow2 --install-type=package
# error log when deploy image.
Error from last host: cloud-ironic (node ef89b610-96ab-473f-a0d8-9294d7efd4d8): [u'Traceback (most recent call last):\n', u' File "/usr/lib/python2.7/site-packages/nova/compute/manager.py", line 1780, in _do_build_and_run_instance\n filter_properties)\n', u' File "/usr/lib/python2.7/site-packages/nova/compute/manager.py", line 2016, in _build_and_run_instance\n instance_uuid=instance.uuid, reason=six.text_type(e))\n', u'RescheduledException: Build of instance 90c19c46-5b31-4134-8fd3-233e390d48f0 was re-scheduled: Failed to provision instance 90c19c46-5b31-4134-8fd3-233e390d48f0: Failed to install a bootloader when deploying node ef89b610-96ab-473f-a0d8-9294d7efd4d8. Error: {u\'message\': u\'Command execution failed: Installing GRUB2 boot loader to device /dev/sda failed with Unexpected error while running command.\\nCommand: chroot /tmp/tmpApABFG /bin/sh -c "/usr/sbin/grub-install /dev/sda"\\nExit code: 1\\nStdout: u\\\'\\\'\\nStderr: u\\\'Could not find device for /dev/vda1\\\\nCould not find device for /dev/vda1\\\\nCould not find device for /dev/vda1\\\\n/dev/vda1: Not found or not a block device.\\\\n\\\'.\', u\'code\': 500, u\'type\': u\'CommandExecutionError\', u\'details\': u\'Installing GRUB2 boot loader to device /dev/sda failed with Unexpected error while running command.\\nCommand: chroot /tmp/tmpApABFG /bin/sh -c "/usr/sbin/grub-install /dev/sda"\\nExit code: 1\\nStdout: u\\\'\\\'\\nStderr: u\\\'Could not find device for /dev/vda1\\\\nCould not find device for /dev/vda1\\\\nCould not find device for /dev/vda1\\\\n/dev/vda1: Not found or not a block device.\\\\n\\\'.\'}\n']
It seems that If I want to deploy baremetal with local boot, the image must contain grub2 package.
https:/ /github. com/openstack/ ironic- python- agent/blob/ master/ ironic_ python_ agent/extension s/image. py#L145
Centos6 has no grub2 package, I know my issue is not a true issue.
but why not report error when building image?
I found the error from build output. server- 5.3p1-123. el6_9.x86_ 64 already installed and latest version 0.6-12. el6.x86_ 64 already installed and latest version 19-6.el6. x86_64 already installed and latest version 5.3p1-123. el6_9.x86_ 64 already installed and latest version modules- growroot modules- growroot available. growpart growpart available.
> No package grub2-efi-modules available.
> Checking for virtual provide or file-provide for grub2-efi
> No package grub2-efi available.
> Checking for virtual provide or file-provide for shim
> No package shim available.
> Package openssh-
> Package rsync-3.
> Checking for virtual provide or file-provide for grub2
> No package grub2 available.
> Checking for virtual provide or file-provide for ccache
> No package ccache available.
> Package which-2.
> Package openssh-
> Checking for virtual provide or file-provide for dracut-
> No package dracut-
> Checking for virtual provide or file-provide for cloud-utils-
> No package cloud-utils-