コード例 #1
0
    def buildDomain(self):
        store_evtchn = self.vm.getStorePort()

        memmax_mb = self.getRequiredMaximumReservation() / 1024
        mem_mb = self.getRequiredInitialReservation() / 1024

        log.debug("domid          = %d", self.vm.getDomid())
        log.debug("image          = %s", self.loader)
        log.debug("store_evtchn   = %d", store_evtchn)
        log.debug("memsize        = %d", memmax_mb)
        log.debug("target         = %d", mem_mb)
        log.debug("vcpus          = %d", self.vm.getVCpuCount())
        log.debug("vcpu_avail     = %li", self.vm.getVCpuAvail())
        log.debug("acpi           = %d", self.acpi)
        log.debug("apic           = %d", self.apic)

        rc = xc.hvm_build(
            domid=self.vm.getDomid(),
            image=self.loader,
            memsize=memmax_mb,
            target=mem_mb,
            vcpus=self.vm.getVCpuCount(),
            vcpu_avail=self.vm.getVCpuAvail(),
            acpi=self.acpi,
            apic=self.apic,
        )
        rc["notes"] = {"SUSPEND_CANCEL": 1}

        rc["store_mfn"] = xc.hvm_get_param(self.vm.getDomid(), HVM_PARAM_STORE_PFN)
        xc.hvm_set_param(self.vm.getDomid(), HVM_PARAM_STORE_EVTCHN, store_evtchn)

        return rc
コード例 #2
0
    def buildDomain(self):
        store_evtchn = self.vm.getStorePort()

        memmax_mb = self.getRequiredMaximumReservation() / 1024
        mem_mb = self.getRequiredInitialReservation() / 1024

        log.debug("domid          = %d", self.vm.getDomid())
        log.debug("image          = %s", self.loader)
        log.debug("store_evtchn   = %d", store_evtchn)
        log.debug("memsize        = %d", memmax_mb)
        log.debug("target         = %d", mem_mb)
        log.debug("vcpus          = %d", self.vm.getVCpuCount())
        log.debug("vcpu_avail     = %li", self.vm.getVCpuAvail())
        log.debug("acpi           = %d", self.acpi)
        log.debug("apic           = %d", self.apic)

        rc = xc.hvm_build(domid=self.vm.getDomid(),
                          image=self.loader,
                          memsize=memmax_mb,
                          target=mem_mb,
                          vcpus=self.vm.getVCpuCount(),
                          vcpu_avail=self.vm.getVCpuAvail(),
                          acpi=self.acpi,
                          apic=self.apic)
        rc['notes'] = {'SUSPEND_CANCEL': 1}

        rc['store_mfn'] = xc.hvm_get_param(self.vm.getDomid(),
                                           HVM_PARAM_STORE_PFN)
        xc.hvm_set_param(self.vm.getDomid(), HVM_PARAM_STORE_EVTCHN,
                         store_evtchn)

        return rc
コード例 #3
0
    def buildDomain(self):
        store_evtchn = self.vm.getStorePort()

        mem_mb = self.getRequiredInitialReservation() / 1024

        log.debug("domid          = %d", self.vm.getDomid())
        log.debug("image          = %s", self.kernel)
        log.debug("store_evtchn   = %d", store_evtchn)
        log.debug("memsize        = %d", mem_mb)
        log.debug("vcpus          = %d", self.vm.getVCpuCount())
        log.debug("acpi           = %d", self.acpi)
        log.debug("apic           = %d", self.apic)

        rc = xc.hvm_build(domid          = self.vm.getDomid(),
                          image          = self.kernel,
                          memsize        = mem_mb,
                          vcpus          = self.vm.getVCpuCount(),
                          acpi           = self.acpi,
                          apic           = self.apic)
        rc['notes'] = { 'SUSPEND_CANCEL': 1 }

        rc['store_mfn'] = xc.hvm_get_param(self.vm.getDomid(),
                                           HVM_PARAM_STORE_PFN)
        xc.hvm_set_param(self.vm.getDomid(), HVM_PARAM_STORE_EVTCHN,
                         store_evtchn)

        return rc
コード例 #4
0
    def buildDomain(self):
        store_evtchn = self.vm.getStorePort()

        memmax_mb = self.getRequiredMaximumReservation() / 1024
        mem_mb = self.getRequiredInitialReservation() / 1024

        log.debug("domid          = %d", self.vm.getDomid())
        log.debug("image          = %s", self.loader)
        log.debug("store_evtchn   = %d", store_evtchn)
        log.debug("memsize        = %d", memmax_mb)
        log.debug("target         = %d", mem_mb)
        log.debug("vcpus          = %d", self.vm.getVCpuCount())
        log.debug("vcpu_avail     = %li", self.vm.getVCpuAvail())
        log.debug("acpi           = %d", self.acpi)
        log.debug("apic           = %d", self.apic)
        log.debug("smbios_firmware= %s", self.smbios_firmware)
        log.debug("acpi_firmware  = %s", self.acpi_firmware)

        rc = xc.hvm_build(domid          = self.vm.getDomid(),
                          image          = self.loader,
                          memsize        = memmax_mb,
                          target         = mem_mb,
                          vcpus          = self.vm.getVCpuCount(),
                          vcpu_avail     = self.vm.getVCpuAvail(),
                          acpi           = self.acpi,
                          apic           = self.apic,
                          smbios_firmware= self._readFirmwareFile(self.smbios_firmware),
                          acpi_firmware  = self._readFirmwareFile(self.acpi_firmware))
        rc['notes'] = { 'SUSPEND_CANCEL': 1 }

        rc['store_mfn'] = xc.hvm_get_param(self.vm.getDomid(),
                                           HVM_PARAM_STORE_PFN)
        xc.hvm_set_param(self.vm.getDomid(), HVM_PARAM_STORE_EVTCHN,
                         store_evtchn)

        console_mfn = xc.hvm_get_param(self.vm.getDomid(), HVM_PARAM_CONSOLE_PFN)
        xc.gnttab_hvm_seed(domid = self.vm.getDomid(),
                           console_gmfn = console_mfn,
                           xenstore_gmfn = rc['store_mfn'],
                           console_domid = 0,
                           xenstore_domid = 0)

        return rc
コード例 #5
0
ファイル: image.py プロジェクト: Hearen/OnceServer
    def buildDomain(self):
        store_evtchn = self.vm.getStorePort()

        memmax_mb = self.getRequiredMaximumReservation() / 1024
        mem_mb = self.getRequiredInitialReservation() / 1024

        log.debug("domid          = %d", self.vm.getDomid())
        log.debug("image          = %s", self.loader)
        log.debug("store_evtchn   = %d", store_evtchn)
        log.debug("memsize        = %d", memmax_mb)
        log.debug("target         = %d", mem_mb)
        log.debug("vcpus          = %d", self.vm.getVCpuCount())
        log.debug("vcpu_avail     = %li", self.vm.getVCpuAvail())
        log.debug("acpi           = %d", self.acpi)
        log.debug("apic           = %d", self.apic)

        rc = xc.hvm_build(domid          = self.vm.getDomid(),
                          image          = self.loader,
                          memsize        = memmax_mb,
                          target         = mem_mb,
                          vcpus          = self.vm.getVCpuCount(),
                          vcpu_avail     = self.vm.getVCpuAvail(),
                          acpi           = self.acpi,
                          apic           = self.apic)
        rc['notes'] = { 'SUSPEND_CANCEL': 1 }

        rc['store_mfn'] = xc.hvm_get_param(self.vm.getDomid(),
                                           HVM_PARAM_STORE_PFN)
        xc.hvm_set_param(self.vm.getDomid(), HVM_PARAM_STORE_EVTCHN,
                         store_evtchn)

        console_mfn = xc.hvm_get_param(self.vm.getDomid(), HVM_PARAM_CONSOLE_PFN)
        xc.gnttab_hvm_seed(domid = self.vm.getDomid(),
                           console_gmfn = console_mfn,
                           xenstore_gmfn = rc['store_mfn'],
                           console_domid = 0,
                           xenstore_domid = 0)

        return rc