You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jclouds.apache.org by Mahmoud Ismail <ma...@gmail.com> on 2018/10/16 10:09:43 UTC

NullPointerException in GCE attach local-ssd disk

Hello,

I was trying to create a local ssd disk (NVMe) to my vm instance on GCE and
i got this null pointer exception

! java.lang.NullPointerException: Null sourceImage ! at
org.jclouds.googlecomputeengine.domain.AutoValue_AttachDisk_InitializeParams.<init>(AutoValue_AttachDisk_InitializeParams.java:24)
~[google-compute-engine-2.1.1.jar:2.1.1]
! at
org.jclouds.googlecomputeengine.domain.AttachDisk$InitializeParams.create(AttachDisk.java:52)
~[google-compute-engine-2.1.1.jar:2.1.1]

AttachDisk nvme = AttachDisk.create(AttachDisk.Type.SCRATCH,
    AttachDisk.Mode.READ_WRITE, null, null, false,
    AttachDisk.InitializeParams.create(null,null,
        null, diskType), true, null,
    AttachDisk.DiskInterface.NVME);


Jclouds complains that the sourceImage is null, however, the source image
is not needed for the local-ssd diskType.

Is there is another way to create local ssd disks in GCE using jclouds?

As a workaround, i marked the sourceImage in AttachDisk.InitializeParams as
Nullable, and recompiled the jclouds code. That seems to fix my issue.

Regards,
Mahmoud

Re: NullPointerException in GCE attach local-ssd disk

Posted by Mahmoud Ismail <ma...@gmail.com>.
Ok, will do so.

On Tue, Oct 16, 2018 at 12:14 PM Ignasi Barrera <na...@apache.org> wrote:

> Looks like a reasonable patch. Wanna open a pull request?
> On Tue, 16 Oct 2018 at 12:10, Mahmoud Ismail
> <ma...@gmail.com> wrote:
> >
> > Hello,
> >
> > I was trying to create a local ssd disk (NVMe) to my vm instance on GCE
> and i got this null pointer exception
> >
> > ! java.lang.NullPointerException: Null sourceImage ! at
> org.jclouds.googlecomputeengine.domain.AutoValue_AttachDisk_InitializeParams.<init>(AutoValue_AttachDisk_InitializeParams.java:24)
> ~[google-compute-engine-2.1.1.jar:2.1.1]
> > ! at
> org.jclouds.googlecomputeengine.domain.AttachDisk$InitializeParams.create(AttachDisk.java:52)
> ~[google-compute-engine-2.1.1.jar:2.1.1]
> >
> > AttachDisk nvme = AttachDisk.create(AttachDisk.Type.SCRATCH,
> >     AttachDisk.Mode.READ_WRITE, null, null, false,
> >     AttachDisk.InitializeParams.create(null,null,
> >         null, diskType), true, null,
> >     AttachDisk.DiskInterface.NVME);
> >
> >
> > Jclouds complains that the sourceImage is null, however, the source
> image is not needed for the local-ssd diskType.
> >
> > Is there is another way to create local ssd disks in GCE using jclouds?
> >
> > As a workaround, i marked the sourceImage in AttachDisk.InitializeParams
> as Nullable, and recompiled the jclouds code. That seems to fix my issue.
> >
> > Regards,
> > Mahmoud
> >
>

Re: NullPointerException in GCE attach local-ssd disk

Posted by Ignasi Barrera <na...@apache.org>.
Looks like a reasonable patch. Wanna open a pull request?
On Tue, 16 Oct 2018 at 12:10, Mahmoud Ismail
<ma...@gmail.com> wrote:
>
> Hello,
>
> I was trying to create a local ssd disk (NVMe) to my vm instance on GCE and i got this null pointer exception
>
> ! java.lang.NullPointerException: Null sourceImage ! at org.jclouds.googlecomputeengine.domain.AutoValue_AttachDisk_InitializeParams.<init>(AutoValue_AttachDisk_InitializeParams.java:24) ~[google-compute-engine-2.1.1.jar:2.1.1]
> ! at org.jclouds.googlecomputeengine.domain.AttachDisk$InitializeParams.create(AttachDisk.java:52) ~[google-compute-engine-2.1.1.jar:2.1.1]
>
> AttachDisk nvme = AttachDisk.create(AttachDisk.Type.SCRATCH,
>     AttachDisk.Mode.READ_WRITE, null, null, false,
>     AttachDisk.InitializeParams.create(null,null,
>         null, diskType), true, null,
>     AttachDisk.DiskInterface.NVME);
>
>
> Jclouds complains that the sourceImage is null, however, the source image is not needed for the local-ssd diskType.
>
> Is there is another way to create local ssd disks in GCE using jclouds?
>
> As a workaround, i marked the sourceImage in AttachDisk.InitializeParams as Nullable, and recompiled the jclouds code. That seems to fix my issue.
>
> Regards,
> Mahmoud
>