Package com.abiquo.ssm.model

Examples of com.abiquo.ssm.model.Pool


    private Map<String, Pool> pools = new HashMap<String, Pool>();

    public InMemoryStoragePlugin()
    {
        // Add a default storage pool
        Pool pool = new Pool();
        pool.setName("In Memory");
        pool.setSizeInMB(51200L); // 50 GB
        pool.setUsedInMB(25600L); // 25 GB
        pool.setAvailableInMB(25600L); // 25 GB

        pools.put(pool.getName(), pool);
    }
View Full Code Here


    }

    @Override
    public Pool getPool(final Device device, final String poolName) throws PluginException
    {
        Pool pool = pools.get(poolName);
        if (pool == null)
        {
            throw new PluginException(PluginError.RESOURCE_NOT_FOUND, "Unexisting pool");
        }
        return pool;
View Full Code Here

        created.setIscsiAddress(iscsiAddress);

        volumes.put(created.getUuid(), created);

        // Update the available size in the pool
        Pool updatedPool = pools.get(pool.getName());
        updatedPool.setUsedInMB(updatedPool.getUsedInMB() + created.getSizeInMB());
        updatedPool.setAvailableInMB(updatedPool.getSizeInMB() - updatedPool.getUsedInMB());

        return created;
    }
View Full Code Here

        }

        Volume removed = volumes.remove(uuid);

        // Update the available size in the pool
        Pool updatedPool = pools.get(pool.getName());
        updatedPool.setUsedInMB(updatedPool.getUsedInMB() - removed.getSizeInMB());
        updatedPool.setAvailableInMB(updatedPool.getSizeInMB() - updatedPool.getUsedInMB());
    }
View Full Code Here

        volumes.put(volume.getUuid(), resize);

        long sizeIncrement = volume.getSizeInMB() - original.getSizeInMB();

        // Update the available size in the pool
        Pool updatedPool = pools.get(pool.getName());
        updatedPool.setUsedInMB(updatedPool.getUsedInMB() + sizeIncrement);
        updatedPool.setAvailableInMB(updatedPool.getSizeInMB() - updatedPool.getUsedInMB());

        return resize;
    }
View Full Code Here

    private Map<String, Pool> pools = new HashMap<String, Pool>();

    public InMemoryStoragePlugin()
    {
        // Add a default storage pool
        Pool pool = new Pool();
        pool.setName("In Memory");
        pool.setType("ISCSI");
        pool.setSizeInMB(51200L); // 50 GB
        pool.setUsedInMB(25600L); // 25 GB
        pool.setAvailableInMB(25600L); // 25 GB

        pools.put(pool.getName(), pool);
    }
View Full Code Here

    }

    @Override
    public Pool getPool(final Device device, final String poolName) throws PluginException
    {
        Pool pool = pools.get(poolName);
        if (pool == null)
        {
            throw new PluginException(PluginError.RESOURCE_NOT_FOUND, "Unexisting pool");
        }
        return pool;
View Full Code Here

            "iqn.1993-08.org.debian:01:b22bb69c97d3", 0));

        volumes.put(created.getUuid(), created);

        // Update the available size in the pool
        Pool updatedPool = pools.get(pool.getName());
        updatedPool.setUsedInMB(updatedPool.getUsedInMB() + created.getSizeInMB());
        updatedPool.setAvailableInMB(updatedPool.getSizeInMB() - updatedPool.getUsedInMB());

        return created;
    }
View Full Code Here

        }

        Volume removed = volumes.remove(uuid);

        // Update the available size in the pool
        Pool updatedPool = pools.get(pool.getName());
        updatedPool.setUsedInMB(updatedPool.getUsedInMB() - removed.getSizeInMB());
        updatedPool.setAvailableInMB(updatedPool.getSizeInMB() - updatedPool.getUsedInMB());
    }
View Full Code Here

        volumes.put(volume.getUuid(), resize);

        long sizeIncrement = volume.getSizeInMB() - original.getSizeInMB();

        // Update the available size in the pool
        Pool updatedPool = pools.get(pool.getName());
        updatedPool.setUsedInMB(updatedPool.getUsedInMB() + sizeIncrement);
        updatedPool.setAvailableInMB(updatedPool.getSizeInMB() - updatedPool.getUsedInMB());

        return resize;
    }
View Full Code Here

TOP

Related Classes of com.abiquo.ssm.model.Pool

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.