Esempio n. 1
0
 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;
 }
Esempio n. 2
0
 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
       });
 }
Esempio n. 3
0
 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
       });
 }
Esempio n. 4
0
 /**
  * @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
       });
 }
Esempio n. 5
0
 /**
  * @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
       });
 }
Esempio n. 6
0
 public static String getPhysicalVolumeVerbose(String pvName) throws EucalyptusCloudException {
   return SystemUtil.run(new String[] {EUCA_ROOT_WRAPPER, "pvdisplay", "-v", pvName});
 }
Esempio n. 7
0
 public static String createVolumeGroup(String pvName, String vgName)
     throws EucalyptusCloudException {
   return SystemUtil.run(new String[] {EUCA_ROOT_WRAPPER, "vgcreate", vgName, pvName});
 }
Esempio n. 8
0
 public static String getVolumeGroup(String volumeGroup) throws EucalyptusCloudException {
   return SystemUtil.run(new String[] {EUCA_ROOT_WRAPPER, "vgdisplay", volumeGroup});
 }
Esempio n. 9
0
 public static String getPhysicalVolume(String partition) throws EucalyptusCloudException {
   return SystemUtil.run(new String[] {EUCA_ROOT_WRAPPER, "pvdisplay", partition});
 }
Esempio n. 10
0
 public static String createPhysicalVolume(String loDevName) throws EucalyptusCloudException {
   return SystemUtil.run(new String[] {EUCA_ROOT_WRAPPER, "pvcreate", loDevName});
 }
Esempio n. 11
0
 public static String getLvmVersion() throws EucalyptusCloudException {
   return SystemUtil.run(new String[] {EUCA_ROOT_WRAPPER, "lvm", "version"});
 }
Esempio n. 12
0
 public static String disableLogicalVolume(String lvName) throws EucalyptusCloudException {
   return SystemUtil.run(
       new String[] {StorageProperties.EUCA_ROOT_WRAPPER, "lvchange", "-an", lvName});
 }
Esempio n. 13
0
 public static String reduceVolumeGroup(String vgName, String pvName)
     throws EucalyptusCloudException {
   return SystemUtil.run(
       new String[] {StorageProperties.EUCA_ROOT_WRAPPER, "vgreduce", vgName, pvName});
 }
Esempio n. 14
0
 public static String removePhysicalVolume(String loDevName) throws EucalyptusCloudException {
   return SystemUtil.run(
       new String[] {StorageProperties.EUCA_ROOT_WRAPPER, "pvremove", loDevName});
 }
Esempio n. 15
0
 public static String scanVolumeGroups() throws EucalyptusCloudException {
   return SystemUtil.run(new String[] {StorageProperties.EUCA_ROOT_WRAPPER, "vgscan"});
 }
Esempio n. 16
0
 public static String enableLogicalVolume(String lvName) throws EucalyptusCloudException {
   return SystemUtil.run(new String[] {EUCA_ROOT_WRAPPER, "lvchange", "-ay", lvName});
 }