コード例 #1
0
 public vmSpec(SQLiteConnection conn, string friendlyName, VMSoftwareSpec debugSpec, bladeLockType readLock, bladeLockType writeLock)
     : base(conn, friendlyName, debugSpec, readLock, writeLock)
 {
     vmConfigKey = null;
 }
コード例 #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);
        }
コード例 #3
0
 public resultAndBladeName[] _requestAsManyVMAsPossible(string requestorIP, VMHardwareSpec hwSpec, VMSoftwareSpec swSpec)
 {
     return(services.hostStateManager.requestAsManyVMAsPossible(requestorIP, hwSpec, swSpec));
 }
コード例 #4
0
 protected bladeOwnership(SQLiteConnection conn, string friendlyName, VMSoftwareSpec spec, bladeLockType permittedAccessRead, bladeLockType permittedAccessWrite)
     : this(conn, friendlyName, spec.debuggerPort, spec.debuggerKey, permittedAccessRead, permittedAccessWrite)
 {
 }
コード例 #5
0
 public resultAndBladeName _requestAnySingleVM(string requestorIP, VMHardwareSpec hwSpec, VMSoftwareSpec swSpec)
 {
     return(services.hostStateManager.RequestAnySingleVM(requestorIP, hwSpec, swSpec));
 }
コード例 #6
0
ファイル: services.cs プロジェクト: XeroDayLabs/bladeDirector
 public resultAndBladeName[] requestAsManyVMAsPossible(VMHardwareSpec hwSpec, VMSoftwareSpec swSpec)
 {
     return(_requestAsManyVMAsPossible(getSrcIP(), hwSpec, swSpec));
 }
コード例 #7
0
ファイル: services.cs プロジェクト: XeroDayLabs/bladeDirector
 public resultAndBladeName RequestAnySingleVM(VMHardwareSpec hwSpec, VMSoftwareSpec swSpec)
 {
     return(_RequestAnySingleVM(getSrcIP(), hwSpec, swSpec));
 }
コード例 #8
0
ファイル: services.cs プロジェクト: XeroDayLabs/bladeDirector
 private static resultAndBladeName[] _requestAsManyVMAsPossible(string requestorIP, VMHardwareSpec hwSpec, VMSoftwareSpec swSpec)
 {
     return(hostStateManager.requestAsManyVMAsPossible(sanitizeAddress(requestorIP), hwSpec, swSpec));
 }
コード例 #9
0
ファイル: services.cs プロジェクト: XeroDayLabs/bladeDirector
 private static resultAndBladeName _RequestAnySingleVM(string requestorIP, VMHardwareSpec hwSpec, VMSoftwareSpec swSpec)
 {
     return(hostStateManager.RequestAnySingleVM(sanitizeAddress(requestorIP), hwSpec, swSpec));
 }