Ask Your Question
0

Attach ISO image as CDROM to windows instance

asked 2017-04-14 10:43:29 -0600

SunilVP gravatar image

HI,

I have windows 2012 instance running successfully on Openstack Newton on Ubuntu 16.04. All I need is to add an ISO image to the windows instance and be seen by the instance as a CDROM. My /var/lib/nova/instance/xxxxx/libvirt.xml, has no option for CDROM device When I start my instance using $openstack server start mywin, it starts successfully, how do I add an ISO image as CDROM to this instance #virsh attach-disk instance-00000009 ~/virtio-win-0.1.126.iso hdc --type cdrom --mode readonly --config When I run virsh attach-disk it attaches successfully and it update : /etc/libvirt/qemu/instance-0000xx9.xml properly. However it does not reflect on /var/lib/nova/instance/xxxxx/libvirt.xml. I have no idea how to influence the /var/lib/nova/instance/xxxxx/libvirt.xml to see the cdrom Any help will be appreciated.

edit retag flag offensive close merge delete

4 answers

Sort by » oldest newest most voted
1

answered 2017-10-10 02:21:44 -0600

Ukesh gravatar image

After uploading image to the glance, set the below properties, after that create the volume. It will attach the device as /dev/hdx

openstack image set --property hw_cdrom_bus=ide --property hw_disk_bus=ide <image_name>

edit flag offensive delete link more
0

answered 2017-04-20 11:12:01 -0600

SunilVP gravatar image

Now i know for sure nova boot command works to add CD-ROM to an instance, as indicated in my comment. It would be great if this works with $ openstack server add volume --device /dev/hda <instancename> <volumename> The problem with this command, it attaches my volume as /dev/vdb and not as /dev/hda, if this works we don't need nova boot command, can someone tell me why it is not accepting the /dev/hda parameter, where do i go to see the error for this command?

edit flag offensive delete link more
0

answered 2017-04-17 15:19:00 -0600

Bernd Bausch gravatar image

updated 2017-04-17 15:22:47 -0600

virsh is not an OpenStack command. You can't expect it to update OpenStack data structures. Try https://ask.openstack.org/en/question..., for example. Or attach it at boot time.

edit flag offensive delete link more

Comments

Hi, I followed the first suggestion, however this is recognized by Windows Instance as a disk and not as cdrom. Your second suggestion I will try and revert.

SunilVP gravatar imageSunilVP ( 2017-04-17 23:36:00 -0600 )edit

It seems to me that the CLIs don't allow attaching a CDROM to a running instance. When launching an instance with nova boot, you can probably use the --block-device option to attach a CDROM at boot time. The openstack server create command doesn't allow even that.

Bernd Bausch gravatar imageBernd Bausch ( 2017-04-18 20:37:40 -0600 )edit

E.g. --block-device source=image,id=IMAGE_ID,type=cdrom. I didn't test this; more parameters might be required.

Bernd Bausch gravatar imageBernd Bausch ( 2017-04-18 20:41:05 -0600 )edit

I have gotten a workaround, I just copied the ISO image via network to windows instance, then mounted it as CDROM, this works. Although this is not what I want, but atleast this option is there to install third party software to the instance. Nova Boot did not get time yet, will update the results

SunilVP gravatar imageSunilVP ( 2017-04-18 21:47:33 -0600 )edit

nova boot --flavor m2.Win --image 8af1c6f0-2440-4f91-a8c5-1cb66455b152 --key-name mykey --nic net-id=dc2ef45f-1a4e-460d-b4c8-6df1d5983364 --block-device id=90acd25c-60ad-425d-95a4-5189c90d7d41,source=image,dest=volume,bus=ide,device=/dev/hda,size=1,type=cdrom,bootindex=1 mywin4 This command works

SunilVP gravatar imageSunilVP ( 2017-04-20 10:21:15 -0600 )edit
0

answered 2017-04-17 20:46:55 -0600

vblando gravatar image

Do a workaround

  1. Convert Windows CDROM to ISO
  2. Upload ISO to Glance
  3. Create a volume with image as source and load your uploaded ISO there
  4. Attach the volume to your Instance
edit flag offensive delete link more

Comments

Hi, Thanks, when I do this method, in the windows instance this ISO volume is seen as a disk, which needs formatting, this is not what I want, when I attach the volume it should pick it up as a CDROM device and not as a disk device.

SunilVP gravatar imageSunilVP ( 2017-04-17 23:34:26 -0600 )edit

When you do the 4th step, it uses wrong device /dev/vdb hence cannot work as CDROM

SunilVP gravatar imageSunilVP ( 2017-04-20 10:24:35 -0600 )edit

some time ago I tried to attach ISO with virtIO drivers during windows install and and after many attempts I did not succeed so I abandoned it. If you want to do it for the same reason(for. ex to create windows image) I recommend to make it outside openstack and then upload ready image to glance.

Damian Dąbrowski gravatar imageDamian Dąbrowski ( 2017-04-20 15:42:32 -0600 )edit

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

1 follower

Stats

Asked: 2017-04-14 10:43:29 -0600

Seen: 564 times

Last updated: Oct 10