Ask Your Question

Could not find hda disk attached: installed VM begins with setup again

asked 2014-03-21 07:06:18 -0500

rohitist gravatar image


I am using Packstack to try Openstack in a single node.

It is documented in Openstack installation instructions that one should attach a cdrom (named as hdc) in the place of vda to complete the setup of an instance.

I followed the exact procedures, as shown below:

Step 1: display the xml of the instance installed and get the target device, source of the running instance.

[root@localhost ~]# virsh dumpxml instance-0000001a
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='qcow2' cache='none'/>
      <source file='/var/lib/nova/instances/8dd3023b-d61c-4394-b8d5-40a2e66985fa/disk'/>
      <target dev='hda' bus='ide' tray='open'/>
      <alias name='ide0-0-0'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>

Step 2: attach the source disk obtained from above into hda device(also obtained from above).

[root@localhost ~]# virsh attach-disk --type cdrom instance-0000001a --source /var/lib/nova/instances/8dd3023b-d61c-4394-b8d5-40a2e66985fa/disk --target hda
Disk attached successfully

And thus, the attached device should reflect as a partition. But, its nowhere. Please see below again.

[root@localhost ~]# cat /proc/partitions
major minor  #blocks  name

   7        0   21600256 loop0
   7        1    2097152 loop1
   8        0  488386584 sda
   8        1     512000 sda1
   8        2  487873536 sda2
 253        0   52428800 dm-0
 253        1    3932160 dm-1
 253        2  431509504 dm-2

I also noticed that vdb patitions are not there. Thus, when I shutdown the instance and start it again, the same setup process starts.

Please note that there is nothing worth in log files.

Please suggest me things that are taking this wrong and workarounds for the same.

Thanks in advance.

edit retag flag offensive close merge delete


I found it a lot easier to accomplish this using virt-manager. You can shut the VM down, then attach the disk, which will populate the XML for you. Then you aren't troubleshooting options. I'm assuming you are doing this to create images to upload to openstack?

mpetason gravatar imagempetason ( 2014-03-21 13:59:28 -0500 )edit

@mpetason: Thanks for your reply. I have already uploaded image (RHEL) to openstack. Actually, I am trying to create an instance from the uploaded image. After successful setup of the image to create the instance, I am supposed to detach the image and attach an empty disk to the instance. The command shown above to achieve this showed success but when i shut off the instance and restarted it, i found that the setup of the instance began again. This indicates that the image was still attached to the instance and thus, the instance was always booting up from the image.

Later, i found strange behavior. I took the snapshot of the instance when the image was setup for the first time. And I terminated the instance (knowing the fact that this instance would never be persistent) and I created a new instance from the snapshot. This new instance created ...(more)

rohitist gravatar imagerohitist ( 2014-03-24 02:31:26 -0500 )edit

2 answers

Sort by ยป oldest newest most voted

answered 2014-04-10 01:35:08 -0500

shayangnala11 gravatar image

updated 2014-04-10 01:35:59 -0500

I also have this issue. I create an instance from an uploaded centos6.5.iso , and after the setup , it seems OK . But when i shutoff the instance,and start it again,this instance will go into the setup page again . I found this instance's cdrom's type is changed from IDE to virtio disk , i don't know why it is.

edit flag offensive delete link more


Have you tried to take the snapshot of the instance while the total setup process completes? If not, then do this and launch a new instance from the snapshot image. see whether this reinstallation appears again or not.

rohitist gravatar imagerohitist ( 2014-04-11 00:25:54 -0500 )edit

answered 2014-04-03 06:35:56 -0500

rohitist gravatar image

I couldn't make this happen in the way I discussed above:

I mean, 1. create an instance. 2. complete the setup and let the instance running. 3. detach the ISO file from the instance and attach a hda device. 4. restart the VM. 5. shut off the VM and start it again to check whether it has become persistent.

These 5 steps always lead me to reinstallation of the guest OS.

However, I observed one peculiar scenario.

Just after Step 4, I took the snapshot of the running VM. Then, I terminated the instance and launched a fresh VM from the snapshot.

Strange but this time the VM created from the snapshot was persistent. I mean, i shut this new VM and started it. Unlike the "boot from ISO" case, I was not anymore prompted for reinstallation of guest OS.

Thus, anyhow, I assume, my problem is resolved but left me wonder why couldn't i get success from the former 5 steps procedure.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools



Asked: 2014-03-21 07:06:18 -0500

Seen: 1,544 times

Last updated: Apr 10 '14