コード例 #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;
 }
コード例 #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
       });
 }
コード例 #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
       });
 }
コード例 #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
       });
 }
コード例 #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
       });
 }
コード例 #6
0
 public static String getPhysicalVolumeVerbose(String pvName) throws EucalyptusCloudException {
   return SystemUtil.run(new String[] {EUCA_ROOT_WRAPPER, "pvdisplay", "-v", pvName});
 }
コード例 #7
0
 public static String createVolumeGroup(String pvName, String vgName)
     throws EucalyptusCloudException {
   return SystemUtil.run(new String[] {EUCA_ROOT_WRAPPER, "vgcreate", vgName, pvName});
 }
コード例 #8
0
 public static String getVolumeGroup(String volumeGroup) throws EucalyptusCloudException {
   return SystemUtil.run(new String[] {EUCA_ROOT_WRAPPER, "vgdisplay", volumeGroup});
 }
コード例 #9
0
 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});
 }