use of com.cloud.storage.GuestOSVO in project cloudstack by apache.
the class DeployAsIsHelperImpl method updateDeployAsIsTemplateToNewGuestOs.
/**
* Updates the deploy-as-is template guest OS doing:
* - Create a new guest OS with the guest OS description parsed from the OVF
* - Create mappings for the new guest OS and supported hypervisor versions
* - Update the template guest OS ID to the new guest OS ID
*/
private void updateDeployAsIsTemplateToNewGuestOs(VMTemplateVO template, String guestOsType, String guestOsDescription, Hypervisor.HypervisorType hypervisor, Collection<String> hypervisorVersions) {
GuestOSVO newGuestOs = createGuestOsEntry(guestOsDescription);
for (String hypervisorVersion : hypervisorVersions) {
LOGGER.info(String.format("Adding a new guest OS mapping for hypervisor: %s version: %s and " + "guest OS: %s", hypervisor.toString(), hypervisorVersion, guestOsType));
createGuestOsHypervisorMapping(newGuestOs.getId(), guestOsType, hypervisor.toString(), hypervisorVersion);
}
updateTemplateGuestOsId(template, newGuestOs.getId());
}
use of com.cloud.storage.GuestOSVO in project cloudstack by apache.
the class BareMetalGuru method implement.
@Override
public VirtualMachineTO implement(VirtualMachineProfile vm) {
VirtualMachineTO to = toVirtualMachineTO(vm);
VMInstanceVO vo = _vmDao.findById(vm.getId());
if (vo.getLastHostId() == null) {
to.setBootArgs(BaremetalManager.DO_PXE);
}
Map<String, String> details = new HashMap<String, String>();
details.put("template", vm.getTemplate().getUrl());
to.setDetails(details);
// Determine the VM's OS description
GuestOSVO guestOS = _guestOsDao.findById(vm.getVirtualMachine().getGuestOSId());
to.setOs(guestOS.getDisplayName());
return to;
}
Aggregations