Package com.cloud.agent.api

Examples of com.cloud.agent.api.BackupSnapshotCommand


    @Before
    public void setUp() {

        StoragePool pool = Mockito.mock(StoragePool.class);

        bsc = new BackupSnapshotCommand(
                "secondaryStoragePoolURL", 101L, 102L, 103L, 104L, 105L,
                "volumePath", pool, "snapshotUuid", "snapshotName",
                "prevSnapshotUuid", "prevBackupUuid", false, "vmName", 5);
        bsa = new BackupSnapshotAnswer(bsc, true, "results", "bussname", false);
    }
View Full Code Here


    public void setUp() {

        StoragePool pool = Mockito.mock(StoragePool.class);

        bsc =
            new BackupSnapshotCommand("secondaryStoragePoolURL", 101L, 102L, 103L, 104L, 105L, "volumePath", pool, "snapshotUuid", "snapshotName", "prevSnapshotUuid",
                "prevBackupUuid", false, "vmName", 5);
        bsa = new BackupSnapshotAnswer(bsc, true, "results", "bussname", false);
    }
View Full Code Here

                }
            }
            boolean isVolumeInactive = _storageMgr.volumeInactive(volume);
            String vmName = _storageMgr.getVmNameOnVolume(volume);
            StoragePoolVO srcPool = _storagePoolDao.findById(volume.getPoolId());
            BackupSnapshotCommand backupSnapshotCommand = new BackupSnapshotCommand(primaryStoragePoolNameLabel, secondaryStoragePoolUrl, dcId, accountId, volumeId, snapshot.getId(), volume.getPath(), srcPool, snapshotUuid,
                    snapshot.getName(), prevSnapshotUuid, prevBackupUuid, isVolumeInactive, vmName, _backupsnapshotwait);

            if ( swift != null ) {
                backupSnapshotCommand.setSwift(swift);
            }
           
            String backedUpSnapshotUuid = null;
            // By default, assume failed.
            boolean backedUp = false;
            BackupSnapshotAnswer answer = (BackupSnapshotAnswer) sendToPool(volume, backupSnapshotCommand);
            if (answer != null && answer.getResult()) {
                backedUpSnapshotUuid = answer.getBackupSnapshotName();
                if (backedUpSnapshotUuid != null) {
                    backedUp = true;
                }
            } else if (answer != null) {
                s_logger.error(answer.getDetails());
            }
            // Update the status in all cases.
            Transaction txn = Transaction.currentTxn();
            txn.start();

            if (backedUp) {
                if (backupSnapshotCommand.getSwift() != null ) {
                    snapshot.setSwiftId(swift.getId());
                    snapshot.setBackupSnapshotId(backedUpSnapshotUuid);
                } else {
                    snapshot.setSecHostId(secHost.getId());
                    snapshot.setBackupSnapshotId(backedUpSnapshotUuid);
View Full Code Here

    @Before
    public void setUp() {

        StoragePool pool = Mockito.mock(StoragePool.class);

        bsc = new BackupSnapshotCommand(
                "secondaryStoragePoolURL", 101L, 102L, 103L, 104L,
                "volumePath", pool, "snapshotUuid", "snapshotName",
                "prevSnapshotUuid", "prevBackupUuid", false, "vmName", 5);
        bsa = new BackupSnapshotAnswer(bsc, true, "results", "bussname", false);
    }
View Full Code Here

TOP

Related Classes of com.cloud.agent.api.BackupSnapshotCommand

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.