# Cannot get dev=sda bus=sata

**URL:** <https://forum.opennebula.io/t/cannot-get-dev-sda-bus-sata/3461>\
**Category:** Product Support\
**Created:** [December 16, 2016, 11:29pm UTC](https://forum.opennebula.io/t/cannot-get-dev-sda-bus-sata/3461 "2016-12-16T23:29:07Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![cro](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/cro/32/4537_2.png) [@cro](https://forum.opennebula.io/u/cro)\
**Post date:** [December 16, 2016, 11:29pm UTC](https://forum.opennebula.io/t/cannot-get-dev-sda-bus-sata/3461/1 "2016-12-16T23:29:07Z")

</div>

Greetings,

I am trying to create a template for a very specific type of machine on OpenNebula 5.2.0. This OS currently only supports a SATA boot device, but no matter what I put in the template the resulting XML is

`<target dev='sda'/>` or `<target dev='sda' bus='scsi'/>`

when I need it to be

`<target dev='sda' bus='sata'/>`

I’ve tried changing the bus type for the disk image to ‘custom’ and typing ‘sata’ into the box, and setting an attribute on the image definition called ‘BUS’. No matter what I do the bus gets set to ‘scsi’ or somehow qemu thinks I am requesting an old-style parallel IDE disk.

I found an issue discussing this ([https://dev.opennebula.org/issues/3061](https://dev.opennebula.org/issues/3061)), and I suspect the ‘custom’ option was intended to address it, but it doesn’t seem to be wired up. Ideas? Thanks.

---

<div class="post-metadata">

**Author:** ![cro](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/cro/32/4537_2.png) [@cro](https://forum.opennebula.io/u/cro)\
**Post date:** [December 17, 2016, 12:32am UTC](https://forum.opennebula.io/t/cannot-get-dev-sda-bus-sata/3461/2 "2016-12-17T00:32:04Z")

</div>

Sorry to reply to my own post, but I did find a workaround.

In the “Target device” field for the boot disk I put

`sda' bus='sata`

Note the seemingly mismatched quotes. ONE’s xml template facility just blindly copies the field contents and generates what I wanted, which was

`<target dev='sda' bus='sata'/>`

and now the machine boots!

I’m guessing this is not the **right** way to do this, but it gets me to the next step.

---

<div class="post-metadata">

**Author:** ![VURoland](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/vuroland/32/7682_2.png) [@VURoland](https://forum.opennebula.io/u/VURoland)\
**Post date:** [December 19, 2016, 12:22pm UTC](https://forum.opennebula.io/t/cannot-get-dev-sda-bus-sata/3461/3 "2016-12-19T12:22:05Z")

</div>

DEV\_PREFIX is used to specify the target, and to keep opennebula as hypervisor agnostic as possible, they choose that path. Still, it will not let you specify the bus that way, maybe it is an option to pass this as raw data to the hypervisor ?

When you update a template in sunstone, the “other” tab allows you to place raw XML code that opennebula passes to the hypervisor, maybe that will allow you to specify specific settings ?

as an example, this is what we needed to add for CPU passthrough in KVM, maybe something similar can be done to specify the bus, or to replace the entire storage part of your template instead:

```
Tab: Other
Field: Raw Data
Type: KVM
Data: <cpu mode='host-passthrough'/>
```

---

<div class="post-metadata">

**Author:** ![simplexify](https://avatars.discourse-cdn.com/v4/letter/s/f07891/32.png) [@simplexify](https://forum.opennebula.io/u/simplexify)\
**Post date:** [December 29, 2017, 8:07pm UTC](https://forum.opennebula.io/t/cannot-get-dev-sda-bus-sata/3461/4 "2017-12-29T20:07:39Z")

</div>

Thank you for sharing your workaround, this solved an issue we were facing!

---

<div class="post-metadata">

**Author:** ![madko](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/madko/32/4195_2.png) [@madko](https://forum.opennebula.io/u/madko)\
**Post date:** [February 16, 2018, 1:42pm UTC](https://forum.opennebula.io/t/cannot-get-dev-sda-bus-sata/3461/5 "2018-02-16T13:42:07Z")

</div>

Will it be properly fixed ?

This workaround only seems to work for 1 disk. We try to add a sdb:  
erreur :unsupported configuration: target must be 0 for ide controller

In the disk attach view in sunstone, there are also many input fields (image mapping driver,  
Disk provisioning type, Bus adapter controller) where we can choose “custom”, but no custom field appears. Only for the BUS field we can type something in a custom field, but it doesn’t appear in the deployment XML definition.

---

<div class="post-metadata">

**Author:** ![jorel](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/jorel/32/6552_2.png) [@jorel](https://forum.opennebula.io/u/jorel)\
**Post date:** [October 1, 2019, 10:35am UTC](https://forum.opennebula.io/t/cannot-get-dev-sda-bus-sata/3461/6 "2019-10-01T10:35:43Z")

</div>

In upcoming OpenNebula 5.10 (and also already in master branch) you may configure the SD\_DEVICE\_BUS to either `sata` or `scsi` in VM template or `vmm_exec_kvm.conf`. Then when you choose `DEV_PREFIX="sd"` (in Sunstone you need to choose BUS option `SCSI/SATA`) you should get `bus=sata` in the libvirt deployment.

---

<div class="post-metadata">

**Author:** ![darkfader](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/darkfader/32/4769_2.png) [@darkfader](https://forum.opennebula.io/u/darkfader)\
**Post date:** [March 24, 2024, 12:40am UTC](https://forum.opennebula.io/t/cannot-get-dev-sda-bus-sata/3461/7 "2024-03-24T00:40:25Z")

</div>

happy little exploit right there.
