Package com.cloud.dc

Examples of com.cloud.dc.ClusterVSMMapVO


    @Override
    public boolean remove(Long id) {
        TransactionLegacy txn = TransactionLegacy.currentTxn();
        txn.start();
        ClusterVSMMapVO cluster = createForUpdate();
        //cluster.setClusterId(null);
        //cluster.setVsmId(null);

        update(id, cluster);
View Full Code Here


        when(_networkAsa1000vMapDao.findByAsa1000vId(anyLong())).thenReturn(null);
        when(_networkAsa1000vMapDao.persist(any(NetworkAsa1000vMapVO.class))).thenReturn(mock(NetworkAsa1000vMapVO.class));

        when(_networkModel.isProviderSupportServiceInNetwork(network.getId(), Service.SourceNat, Provider.CiscoVnmc)).thenReturn(true);

        ClusterVSMMapVO clusterVsmMap = mock(ClusterVSMMapVO.class);
        when(_clusterVsmMapDao.findByClusterId(anyLong())).thenReturn(clusterVsmMap);

        CiscoNexusVSMDeviceVO vsmDevice = mock(CiscoNexusVSMDeviceVO.class);
        when(vsmDevice.getUserName()).thenReturn("foo");
        when(vsmDevice.getPassword()).thenReturn("bar");
View Full Code Here

            _ciscoNexusVSMDeviceDao.persist(VSMObj);
        }

        // At this stage, we have a VSM record for sure. Connect the VSM to the cluster Id.
        long vsmId = _ciscoNexusVSMDeviceDao.getVSMbyIpaddress(ipaddress).getId();
        ClusterVSMMapVO connectorObj = new ClusterVSMMapVO(clusterId, vsmId);
        _clusterVSMDao.persist(connectorObj);

        // Now, get a list of all the ESXi servers in this cluster.
        // This is effectively a select * from host where cluster_id=clusterId;
        // All ESXi servers are stored in the host table, and their resource
View Full Code Here

        return _ciscoNexusVSMDeviceDao.findById(vsmId);
    }

    @DB
    public CiscoNexusVSMDeviceVO getCiscoVSMbyClusId(long clusterId) {
        ClusterVSMMapVO mapVO = _clusterVSMDao.findByClusterId(clusterId);
        if (mapVO == null) {
            s_logger.info("Couldn't find a VSM associated with the specified cluster Id");
            return null;
        }
        // Else, pull out the VSM associated with the VSM id in mapVO.
        CiscoNexusVSMDeviceVO result = _ciscoNexusVSMDeviceDao.findById(mapVO.getVsmId());
        return result;
    }
View Full Code Here

                        vsm = _vsmDao.persist(vsm);
                    }
                    // Create a mapping between the cluster and the vsm.
                    vsm = _vsmDao.getVSMbyIpaddress(vsmIp);
                    if (vsm != null) {
                        ClusterVSMMapVO connectorObj = new ClusterVSMMapVO(clusterId, vsm.getId());
                        _clusterVSMDao.persist(connectorObj);
                    }
                    return vsm;
                }
            });
View Full Code Here

                s_logger.error("Unable to assign ASA 1000v device to network " + network.getName());
                return false;
            }

            ClusterVO asaCluster = _clusterDao.findById(assignedAsa.getClusterId());
            ClusterVSMMapVO clusterVsmMap = _clusterVsmMapDao.findByClusterId(assignedAsa.getClusterId());
            if (clusterVsmMap == null) {
                s_logger.error("Vmware cluster " + asaCluster.getName() + " has no Cisco Nexus VSM device associated with it");
                return false;
            }

            CiscoNexusVSMDeviceVO vsmDevice = _vsmDeviceDao.findById(clusterVsmMap.getVsmId());
            if (vsmDevice == null) {
                s_logger.error("Unable to load details of Cisco Nexus VSM device associated with cluster " + asaCluster.getName());
                return false;
            }
View Full Code Here

  }

    @Override
    public Map<String, String> getNexusVSMCredentialsByClusterId(Long clusterId) {
        CiscoNexusVSMDeviceVO nexusVSM = null;
        ClusterVSMMapVO vsmMapVO = null;

        vsmMapVO = _vsmMapDao.findByClusterId(clusterId);
        long vsmId = 0;
        if (vsmMapVO != null) {
            vsmId = vsmMapVO.getVsmId();
            s_logger.info("vsmId is " + vsmId);
            nexusVSM = _nexusDao.findById(vsmId);
            s_logger.info("Fetching nexus vsm credentials from database.");
        }
        else {
View Full Code Here

        }
      }
     
      // At this stage, we have a VSM record for sure. Connect the VSM to the cluster Id.
      long vsmId = _ciscoNexusVSMDeviceDao.getVSMbyIpaddress(ipaddress).getId();
      ClusterVSMMapVO connectorObj = new ClusterVSMMapVO(clusterId, vsmId);
      Transaction txn = Transaction.currentTxn();
      try {
        txn.start();
        _clusterVSMDao.persist(connectorObj);
        txn.commit();
View Full Code Here

      return _ciscoNexusVSMDeviceDao.findById(vsmId);
    }
   
    @DB
    public CiscoNexusVSMDeviceVO getCiscoVSMbyClusId(long clusterId) {
      ClusterVSMMapVO mapVO = _clusterVSMDao.findByClusterId(clusterId);
      if (mapVO == null) {
        s_logger.info("Couldn't find a VSM associated with the specified cluster Id");
        return null;
      }
      // Else, pull out the VSM associated with the VSM id in mapVO.
      CiscoNexusVSMDeviceVO result = _ciscoNexusVSMDeviceDao.findById(mapVO.getVsmId());
      return result;
    }
View Full Code Here

                    }
                }
                // Create a mapping between the cluster and the vsm.
                vsm = _ciscoNexusVSMDeviceDao.getVSMbyIpaddress(vsmIp);
                if (vsm != null) {
                    ClusterVSMMapVO connectorObj = new ClusterVSMMapVO(clusterId, vsm.getId());
                    txn = Transaction.currentTxn();
                    try {
                        txn.start();
                        _clusterVSMDao.persist(connectorObj);
                        txn.commit();
View Full Code Here

TOP

Related Classes of com.cloud.dc.ClusterVSMMapVO

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.