Пример #1
0
    def boot(self, virtPlatform = None, configId=None, installLoc=None, envDirectory=None):
        """
        Boots OvfSet as libvirt domain(s).

        @param configId: configuration identifier
        @type configId: String
        """
        ovf = self.ovfFile.document

        # TODO: Verify reservations DON'T exceed capabilities

        # Get Startup order
        startup = OvfLibvirt.getOvfStartup(ovf)

        if installLoc == None:
            dirpath = os.path.dirname(os.path.abspath(self.ovfFile.path))
        else:
            dirpath = installLoc

        # Get Domain definitions
        domains = OvfLibvirt.getOvfDomains(ovf, dirpath,
                                           virtPlatform, configId,
                                           envDirectory)

        # queue domains with action: domains[id].create()
        schedule = OvfLibvirt.getSchedule(startup, domains)

        schedule.run()
Пример #2
0
def getVsSystemType(vs):
    """
    This function gets the list of system types for the virtual system and
    selects one based on the libvirt capabilities.  It will select the
    first type in the list that is present on the system.
    @type node: DOM node
    @param node: Virtual System node

    @rtype: String
    @return: Platform type for Virtual System
    """
    virtTypes = OvfLibvirt.getOvfSystemType(vs)

    for virtType in virtTypes:
        # check if this virtType is available
        if virtTypeIsAvailable(virtType):
            return virtType

    return None