# Disk attach JAVA OCA

**URL:** <https://forum.opennebula.io/t/disk-attach-java-oca/3258>\
**Category:** Product Support\
**Created:** [November 11, 2016, 1:36pm UTC](https://forum.opennebula.io/t/disk-attach-java-oca/3258 "2016-11-11T13:36:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![amenendez](https://avatars.discourse-cdn.com/v4/letter/a/a9a28c/32.png) [@amenendez](https://forum.opennebula.io/u/amenendez)\
**Post date:** [November 11, 2016, 1:36pm UTC](https://forum.opennebula.io/t/disk-attach-java-oca/3258/1 "2016-11-11T13:36:12Z")

</div>

Hi,

I’m developing an app with the Java API of OpenNebula 5.2 and I’m not able to attach disk. I call:

```
VirtualMachine.diskAttach(client, vmId, diskTemplate);

```

where disk template is:

```
DISK = [IMAGE = "image_name", IMAGE_UNAME= "user_name"]

```

(I checked the sunstone action when doing the same and it’s disk template is like this)

And I don’t get any error but the disk is not attached.

¿Anyone deal with a problem like that?

Thanks!
