Esempio n. 1
0
 public vmSpec(SQLiteConnection conn, string friendlyName, VMSoftwareSpec debugSpec, bladeLockType readLock, bladeLockType writeLock)
     : base(conn, friendlyName, debugSpec, readLock, writeLock)
 {
     vmConfigKey = null;
 }
Esempio n. 2
0
        public lockableVMSpec createChildVM(SQLiteConnection conn, hostDB db, VMHardwareSpec reqhw, VMSoftwareSpec reqsw, string newOwner)
        {
            if ((permittedAccessRead & bladeLockType.lockVMCreation) == bladeLockType.lockNone)
            {
                throw new Exception("lockVMCreation is needed when calling .createChildVM");
            }

            vmserverTotals totals        = db.getVMServerTotals(this);
            int            indexOnServer = totals.VMs + 1;
            string         newBladeName  = xdlClusterNaming.makeVMName(bladeIP, indexOnServer);

            // If we set the debugger port automatically, make sure we reset it to zero before we return.
            bool needToResetReqSWDebugPort = false;

            if (reqsw.debuggerPort == 0)
            {
                reqsw.debuggerPort        = xdlClusterNaming.makeVMKernelDebugPort(bladeIP, indexOnServer);
                needToResetReqSWDebugPort = true;
            }

            vmSpec newVM = new vmSpec(conn, newBladeName, reqsw, bladeLockType.lockAll, bladeLockType.lockAll);

            newVM.parentBladeIP = bladeIP;
            newVM.state         = bladeStatus.inUseByDirector;
            newVM.currentOwner  = "vmserver"; // We own the blade until we are done setting it up
            newVM.nextOwner     = newOwner;
            newVM.parentBladeID = bladeID.Value;
            newVM.memoryMB      = reqhw.memoryMB;
            newVM.cpuCount      = reqhw.cpuCount;
            newVM.indexOnServer = indexOnServer;

            newVM.VMIP    = xdlClusterNaming.makeVMIP(bladeIP, newVM);
            newVM.iscsiIP = xdlClusterNaming.makeiSCSIIP(bladeIP, newVM);
            newVM.eth0MAC = xdlClusterNaming.makeEth0MAC(bladeIP, newVM);
            newVM.eth1MAC = xdlClusterNaming.makeEth1MAC(bladeIP, newVM);

            // VMs always have this implicit snapshot.
            newVM.currentSnapshot = "vm";

            if (needToResetReqSWDebugPort)
            {
                reqsw.debuggerPort = 0;
            }

            lockableVMSpec toRet = new lockableVMSpec(newVM.VMIP, bladeLockType.lockAll, bladeLockType.lockAll);

            toRet.setSpec(newVM);
            return(toRet);
        }
Esempio n. 3
0
 public resultAndBladeName[] _requestAsManyVMAsPossible(string requestorIP, VMHardwareSpec hwSpec, VMSoftwareSpec swSpec)
 {
     return(services.hostStateManager.requestAsManyVMAsPossible(requestorIP, hwSpec, swSpec));
 }
 protected bladeOwnership(SQLiteConnection conn, string friendlyName, VMSoftwareSpec spec, bladeLockType permittedAccessRead, bladeLockType permittedAccessWrite)
     : this(conn, friendlyName, spec.debuggerPort, spec.debuggerKey, permittedAccessRead, permittedAccessWrite)
 {
 }
Esempio n. 5
0
 public resultAndBladeName _requestAnySingleVM(string requestorIP, VMHardwareSpec hwSpec, VMSoftwareSpec swSpec)
 {
     return(services.hostStateManager.RequestAnySingleVM(requestorIP, hwSpec, swSpec));
 }
Esempio n. 6
0
 public resultAndBladeName[] requestAsManyVMAsPossible(VMHardwareSpec hwSpec, VMSoftwareSpec swSpec)
 {
     return(_requestAsManyVMAsPossible(getSrcIP(), hwSpec, swSpec));
 }
Esempio n. 7
0
 public resultAndBladeName RequestAnySingleVM(VMHardwareSpec hwSpec, VMSoftwareSpec swSpec)
 {
     return(_RequestAnySingleVM(getSrcIP(), hwSpec, swSpec));
 }
Esempio n. 8
0
 private static resultAndBladeName[] _requestAsManyVMAsPossible(string requestorIP, VMHardwareSpec hwSpec, VMSoftwareSpec swSpec)
 {
     return(hostStateManager.requestAsManyVMAsPossible(sanitizeAddress(requestorIP), hwSpec, swSpec));
 }
Esempio n. 9
0
 private static resultAndBladeName _RequestAnySingleVM(string requestorIP, VMHardwareSpec hwSpec, VMSoftwareSpec swSpec)
 {
     return(hostStateManager.RequestAnySingleVM(sanitizeAddress(requestorIP), hwSpec, swSpec));
 }