Package com.cloud.hypervisor.vmware.mo

Examples of com.cloud.hypervisor.vmware.mo.DatastoreFile


      } while(parsePos > 0);
    return fileList.toArray(new String[0]);
  }

  public String composeDatastoreBrowseUrl(String dcName, String fullPath) {
    DatastoreFile dsFile = new DatastoreFile(fullPath);
    return composeDatastoreBrowseUrl(dcName, dsFile.getDatastoreName(), dsFile.getRelativePath());
  }
View Full Code Here


      } while(parsePos > 0);
    return fileList.toArray(new String[0]);
  }

  public String composeDatastoreBrowseUrl(String dcName, String fullPath) {
    DatastoreFile dsFile = new DatastoreFile(fullPath);
    return composeDatastoreBrowseUrl(dcName, dsFile.getDatastoreName(), dsFile.getRelativePath());
  }
View Full Code Here

                                    s_logger.error("Unexpected exception", e);
                                }

                                s_logger.info("Disk has been consolidated, top VMDK is now: " + topVmdkFilePath);
                                if (topVmdkFilePath != null) {
                                    DatastoreFile file = new DatastoreFile(topVmdkFilePath);

                                    SnapshotObjectTO snapshotInfo = (SnapshotObjectTO)answer.getNewData();
                                    VolumeObjectTO vol = new VolumeObjectTO();
                                    vol.setUuid(srcSnapshot.getVolume().getUuid());
                                    vol.setPath(file.getFileBaseName());
                                    snapshotInfo.setVolume(vol);
                                } else {
                                    s_logger.error("Disk has been consolidated, but top VMDK is not found ?!");
                                }
                            }
View Full Code Here

      } while(parsePos > 0);
    return fileList.toArray(new String[0]);
  }

  public String composeDatastoreBrowseUrl(String dcName, String fullPath) {
    DatastoreFile dsFile = new DatastoreFile(fullPath);
    return composeDatastoreBrowseUrl(dcName, dsFile.getDatastoreName(), dsFile.getRelativePath());
  }
View Full Code Here

                                    s_logger.error("Unexpected exception", e);
                                }

                                s_logger.info("Disk has been consolidated, top VMDK is now: " + topVmdkFilePath);
                                if(topVmdkFilePath != null) {
                                    DatastoreFile file = new DatastoreFile(topVmdkFilePath);

                                    SnapshotObjectTO snapshotInfo = (SnapshotObjectTO)answer.getNewData();
                                    VolumeObjectTO vol = new VolumeObjectTO();
                                    vol.setUuid(srcSnapshot.getVolume().getUuid());
                                    vol.setPath(file.getFileBaseName());
                                    snapshotInfo.setVolume(vol);
                                } else {
                                    s_logger.error("Disk has been consolidated, but top VMDK is not found ?!");
                                }
                            }
View Full Code Here

            for (VirtualDisk virtualDisk : virtualDisks) {
                if (virtualDisk.getBacking() instanceof VirtualDiskFlatVer2BackingInfo) {
                    VirtualDiskFlatVer2BackingInfo backingInfo = (VirtualDiskFlatVer2BackingInfo)virtualDisk.getBacking();
                    String path = backingInfo.getFileName();

                    path = new DatastoreFile(path).getFileBaseName();

                    String search = "-";
                    int index = path.indexOf(search);

                    if (index > -1) {
View Full Code Here

        // we will honor vCenter's meta if it exists
        if(diskInfo != null) {
            // to deal with run-time upgrade to maintain the new datastore folder structure
            String disks[] = diskInfo.getDiskChain();
            for(int i = 0; i < disks.length; i++) {
                DatastoreFile file = new DatastoreFile(disks[i]);
                if (!isManaged && file.getDir() != null && file.getDir().isEmpty()) {
                    s_logger.info("Perform run-time datastore folder upgrade. sync " + disks[i] + " to VM folder");
                    disks[i] = VmwareStorageLayoutHelper.syncVolumeToVmDefaultFolder(
                            dcMo, vmMo.getName(), dsMo, file.getFileBaseName());
                }
            }
            return disks;
        }
View Full Code Here

            VolumeObjectTO volume = (VolumeObjectTO)vol.getData();

            Map<String, String> details = vol.getDetails();
            boolean isManaged = details != null && Boolean.parseBoolean(details.get(DiskTO.MANAGED));

            VirtualMachineDiskInfo diskInfo = diskInfoBuilder.getDiskInfoByBackingFileBaseName(isManaged ? new DatastoreFile(volume.getPath()).getFileBaseName() : volume.getPath());
            if(diskInfo != null) {
                s_logger.info("Found existing disk info from volume path: " + volume.getPath());
                return diskInfo;
            } else {
                String chainInfo = volume.getChainInfo();
                if(chainInfo != null) {
                    VirtualMachineDiskInfo infoInChain = _gson.fromJson(chainInfo, VirtualMachineDiskInfo.class);
                    if(infoInChain != null) {
                        String[] disks = infoInChain.getDiskChain();
                        if(disks.length > 0) {
                            for(String diskPath : disks) {
                                DatastoreFile file = new DatastoreFile(diskPath);
                                diskInfo = diskInfoBuilder.getDiskInfoByBackingFileBaseName(file.getFileBaseName());
                                if(diskInfo != null) {
                                    s_logger.info("Found existing disk from chain info: " + diskPath);
                                    return diskInfo;
                                }
                            }
View Full Code Here

            assert(diskInfo != null);

            String[] diskChain = diskInfo.getDiskChain();
            assert(diskChain.length > 0);

            DatastoreFile file = new DatastoreFile(diskChain[0]);
            if(!file.getFileBaseName().equalsIgnoreCase(volumeTO.getPath())) {
                if(s_logger.isInfoEnabled())
                    s_logger.info("Detected disk-chain top file change on volume: " + volumeTO.getId() + " "
                            + volumeTO.getPath() + " -> " + file.getFileBaseName());
            }

            VolumeObjectTO volInSpec = getVolumeInSpec(vmSpec, volumeTO);
            volInSpec.setPath(file.getFileBaseName());
            volInSpec.setChainInfo(_gson.toJson(diskInfo));
        }
    }
View Full Code Here

TOP

Related Classes of com.cloud.hypervisor.vmware.mo.DatastoreFile

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.