public static boolean logicalVolumeExists(String lvName) {
   boolean success = false;
   String returnValue =
       SystemUtil.run(new String[] {StorageProperties.EUCA_ROOT_WRAPPER, "lvdisplay", lvName});
   if (returnValue.length() > 0) {
     success = true;
   }
   return success;
 }
 public static String createSnapshotLogicalVolume(String lvName, String snapLvName)
     throws EucalyptusCloudException {
   return SystemUtil.run(
       new String[] {
         StorageProperties.EUCA_ROOT_WRAPPER,
         "lvcreate",
         "-n",
         snapLvName,
         "-s",
         "-l",
         "100%FREE",
         lvName
       });
 }
 public static String createLogicalVolume(String volumeId, String vgName, String lvName)
     throws EucalyptusCloudException {
   return SystemUtil.run(
       new String[] {
         StorageProperties.EUCA_ROOT_WRAPPER,
         "lvcreate",
         "--addtag",
         volumeId,
         "-n",
         lvName,
         "-l",
         "100%FREE",
         vgName
       });
 }
 /**
  * @param lvName
  * @param snapLvName
  * @param sizeMB - Volume size in MB
  * @return
  * @throws EucalyptusCloudException
  */
 public static String createSnapshotLogicalVolume(String lvName, String snapLvName, long sizeMB)
     throws EucalyptusCloudException {
   // return SystemUtil.run(new String[]{EUCA_ROOT_WRAPPER, "lvcreate", "-n", snapLvName, "-s",
   // "-L", String.valueOf(size) + "G", lvName});
   return SystemUtil.run(
       new String[] {
         EUCA_ROOT_WRAPPER,
         "lvcreate",
         "-n",
         snapLvName,
         "-s",
         "-L",
         String.valueOf(sizeMB) + "M",
         lvName
       });
 }
 /**
  * @param volumeId
  * @param vgName
  * @param lvName
  * @param sizeMB - Volume size in MB
  * @return
  * @throws EucalyptusCloudException
  */
 public static String createLogicalVolume(
     String volumeId, String vgName, String lvName, long sizeMB) throws EucalyptusCloudException {
   // return SystemUtil.run(new String[]{EUCA_ROOT_WRAPPER, "lvcreate", "-n", lvName, "-L",
   // String.valueOf(size) + "G", vgName});
   return SystemUtil.run(
       new String[] {
         EUCA_ROOT_WRAPPER,
         "lvcreate",
         "--addtag",
         volumeId,
         "-n",
         lvName,
         "-L",
         String.valueOf(sizeMB) + "M",
         vgName
       });
 }
 public static String getPhysicalVolumeVerbose(String pvName) throws EucalyptusCloudException {
   return SystemUtil.run(new String[] {EUCA_ROOT_WRAPPER, "pvdisplay", "-v", pvName});
 }
 public static String createVolumeGroup(String pvName, String vgName)
     throws EucalyptusCloudException {
   return SystemUtil.run(new String[] {EUCA_ROOT_WRAPPER, "vgcreate", vgName, pvName});
 }
 public static String getVolumeGroup(String volumeGroup) throws EucalyptusCloudException {
   return SystemUtil.run(new String[] {EUCA_ROOT_WRAPPER, "vgdisplay", volumeGroup});
 }
 public static String getPhysicalVolume(String partition) throws EucalyptusCloudException {
   return SystemUtil.run(new String[] {EUCA_ROOT_WRAPPER, "pvdisplay", partition});
 }
示例#10
0
 public static String createPhysicalVolume(String loDevName) throws EucalyptusCloudException {
   return SystemUtil.run(new String[] {EUCA_ROOT_WRAPPER, "pvcreate", loDevName});
 }
示例#11
0
 public static String getLvmVersion() throws EucalyptusCloudException {
   return SystemUtil.run(new String[] {EUCA_ROOT_WRAPPER, "lvm", "version"});
 }
示例#12
0
 public static String disableLogicalVolume(String lvName) throws EucalyptusCloudException {
   return SystemUtil.run(
       new String[] {StorageProperties.EUCA_ROOT_WRAPPER, "lvchange", "-an", lvName});
 }
示例#13
0
 public static String reduceVolumeGroup(String vgName, String pvName)
     throws EucalyptusCloudException {
   return SystemUtil.run(
       new String[] {StorageProperties.EUCA_ROOT_WRAPPER, "vgreduce", vgName, pvName});
 }
示例#14
0
 public static String removePhysicalVolume(String loDevName) throws EucalyptusCloudException {
   return SystemUtil.run(
       new String[] {StorageProperties.EUCA_ROOT_WRAPPER, "pvremove", loDevName});
 }
示例#15
0
 public static String scanVolumeGroups() throws EucalyptusCloudException {
   return SystemUtil.run(new String[] {StorageProperties.EUCA_ROOT_WRAPPER, "vgscan"});
 }
示例#16
0
 public static String enableLogicalVolume(String lvName) throws EucalyptusCloudException {
   return SystemUtil.run(new String[] {EUCA_ROOT_WRAPPER, "lvchange", "-ay", lvName});
 }