Codota Logo
Host.getPrivateMacAddress
Code IndexAdd Codota to your IDE (free)

How to use
getPrivateMacAddress
method
in
com.cloud.host.Host

Best Java code snippets using com.cloud.host.Host.getPrivateMacAddress (Showing top 4 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Point p =
  • Codota Iconnew Point(x, y)
  • Codota Iconnew Point()
  • Codota IconMouseEvent e;e.getPoint()
  • Smart code suggestions by Codota
}
origin: apache/cloudstack

@Override
public void prepareVlan(Network nw, DeployDestination destHost) {
  List<BaremetalRctVO> vos = rctDao.listAll();
  if (vos.isEmpty()) {
    throw new CloudRuntimeException("no rack configuration found, please call addBaremetalRct to add one");
  }
  BaremetalRctVO vo = vos.get(0);
  BaremetalRct rct = gson.fromJson(vo.getRct(), BaremetalRct.class);
  RackPair rp = findRack(rct, destHost.getHost().getPrivateMacAddress());
  if (rp == null) {
    throw new CloudRuntimeException(String.format("cannot find any rack contains host[mac:%s], please double check your rack configuration file, update it and call addBaremetalRct again", destHost.getHost().getPrivateMacAddress()));
  }
  int vlan = Integer.parseInt(Networks.BroadcastDomainType.getValue(nw.getBroadcastUri()));
  BaremetalSwitchBackend backend = getSwitchBackend(rp.rack.getL2Switch().getType());
  BaremetalVlanStruct struct = new BaremetalVlanStruct();
  struct.setHostMac(rp.host.getMac());
  struct.setPort(rp.host.getPort());
  struct.setSwitchIp(rp.rack.getL2Switch().getIp());
  struct.setSwitchPassword(rp.rack.getL2Switch().getPassword());
  struct.setSwitchType(rp.rack.getL2Switch().getType());
  struct.setSwitchUsername(rp.rack.getL2Switch().getUsername());
  struct.setVlan(vlan);
  backend.prepareVlan(struct);
}
origin: apache/cloudstack

@Override
@DB
public boolean prepare(Network network, NicProfile nic, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context)
  throws ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException {
  Host host = dest.getHost();
  if (vm.getType() != Type.User || vm.getHypervisorType() != HypervisorType.BareMetal) {
    return false;
  }
  nic.setMacAddress(host.getPrivateMacAddress());
  NicVO vo = _nicDao.findById(nic.getId());
  assert vo != null : "Where ths nic " + nic.getId() + " going???";
  vo.setMacAddress(nic.getMacAddress());
  _nicDao.update(vo.getId(), vo);
  return true;
}
origin: apache/cloudstack

public HostTO(Host vo) {
  guid = vo.getGuid();
  privateNetwork = new NetworkTO(vo.getPrivateIpAddress(), vo.getPrivateNetmask(), vo.getPrivateMacAddress());
  if (vo.getPublicIpAddress() != null) {
    publicNetwork = new NetworkTO(vo.getPublicIpAddress(), vo.getPublicNetmask(), vo.getPublicMacAddress());
  }
  if (vo.getStorageIpAddress() != null) {
    storageNetwork1 = new NetworkTO(vo.getStorageIpAddress(), vo.getStorageNetmask(), vo.getStorageMacAddress());
  }
  if (vo.getStorageIpAddressDeux() != null) {
    storageNetwork2 = new NetworkTO(vo.getStorageIpAddressDeux(), vo.getStorageNetmaskDeux(), vo.getStorageMacAddressDeux());
  }
}
origin: apache/cloudstack

@Override
@DB
public boolean prepare(Network network, NicProfile nic, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context)
  throws ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException {
  if (vm.getType() != Type.User || vm.getHypervisorType() != HypervisorType.BareMetal) {
    return false;
  }
  VMInstanceVO vo = _vmDao.findById(vm.getId());
  assert vo != null : "Where ths nic " + nic.getId() + " going???";
  if (vo.getLastHostId() == null) {
    nic.setMacAddress(dest.getHost().getPrivateMacAddress());
    NicVO nicVo = _nicDao.findById(nic.getId());
    nicVo.setMacAddress(nic.getMacAddress());
    _nicDao.update(nicVo.getId(), nicVo);
    /*This vm is just being created */
    if (!_pxeMgr.prepare(vm, nic, network, dest, context)) {
      throw new CloudRuntimeException("Cannot prepare pxe server");
    }
  }
  if (dest.getDataCenter().getNetworkType() == DataCenter.NetworkType.Advanced){
    prepareVlan(network, dest);
  }
  return true;
}
com.cloud.hostHostgetPrivateMacAddress

Popular methods of Host

  • getId
  • getHypervisorType
  • getName
  • getPrivateIpAddress
  • getClusterId
  • getType
  • getUuid
  • getDataCenterId
  • getStatus
  • getGuid
  • getPodId
  • getPublicIpAddress
  • getPodId,
  • getPublicIpAddress,
  • getManagementServerId,
  • getRemoved,
  • getStorageIpAddress,
  • isInMaintenanceStates,
  • getCapabilities,
  • getCpuSockets,
  • getCpus

Popular in Java

  • Updating database using SQL prepared statement
  • findViewById (Activity)
  • setContentView (Activity)
  • getContentResolver (Context)
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • Vector (java.util)
    The Vector class implements a growable array of objects. Like an array, it contains components that
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now