@Singleton
public class VCloudHardwareBuilderFromResourceAllocations extends HardwareBuilderFromResourceAllocations {
@Override
public Volume apply(ResourceAllocationSettingData from) {
if (from instanceof VCloudHardDisk) {
VCloudHardDisk vDisk = VCloudHardDisk.class.cast(from);
return new VolumeImpl(from.getAddressOnParent() + "", Volume.Type.LOCAL, vDisk.getCapacity() / 1024f, null,
"0".equals(from.getAddressOnParent()), true);
} else {
return super.apply(from);
}