{
registerImageRequest = registerImageRequest.
withBlockDeviceMappings(
new BlockDeviceMapping().
withDeviceName(rootDeviceName.get()).
withEbs(new EbsBlockDevice().
withSnapshotId(testSnapshot.get().getSnapshotId())),
new BlockDeviceMapping().
withDeviceName("/dev/sda2").
withVirtualName("ephemeral0"),
new BlockDeviceMapping().
withDeviceName("/dev/sda3").
withVirtualName("ephemeral1"));
}
else
{
registerImageRequest = registerImageRequest.
withBlockDeviceMappings(
new BlockDeviceMapping().
withDeviceName(rootDeviceName.get()).
withEbs(new EbsBlockDevice().
withSnapshotId(testSnapshot.get().getSnapshotId())),
new BlockDeviceMapping().
withDeviceName("/dev/sdb").
withVirtualName("ephemeral0"),
new BlockDeviceMapping().