Ejemplo n.º 1
0
 public HelperClass(VmpsData Vmdatas)
 {
     Vmdata = Vmdatas;
       virtualHost.ConnectToVMWareWorkstation();
       vmconfiglist = SheduleVmpsConfig.GetConfigDetails();
 }
Ejemplo n.º 2
0
        public static void GetVirtualMachineStatus( string[] argment)
        {
            VmpsData Vmdata = new VmpsData();
            foreach (string vm in argment)
            {
                string[] vid = vm.Split('=');
                if (vid[0] == "MODE")
                {
                    Vmdata.Modeval= vid[1];
                }
                else if (vid[0] == "ID")
                {
                    Vmdata.Idval = vid[1];
                }
                else if (vid[0] == "JOBID")
                {
                    Vmdata.Jobid = vid[1];
                }

                #region
                //else if (vid[0] == "VMFilePath")
                //{
                //    Vmdata.PathToVMWareVMXFile = vid[1];

                //}
                //else if (vid[0] == "ShutdownVM")
                //{
                //    Vmdata.ShutdownVMWarw = vid[1];

                //}
                //else if (vid[0] == "SnapshotVM")
                //{
                //    Vmdata.SnapshotName = vid[1];

                //}
                //else if (vid[0] == "StatusVMWarw")
                //{
                //    Vmdata.StatusVMWarw = vid[1];

                //}
            #endregion
            }

            HelperClass hs=new HelperClass(Vmdata);

            //StartVm
            if (Vmdata.Modeval == "Startvm")
            {
                Log.Info("Start VM");

                hs.StartVm();
            }
            //List Currently Running Vm
            else if (Vmdata.Modeval == "Showlivevm")//Get Live vm's-modify
            {
                hs.Showrunningvm();
            }
            //Check Vm Status
            else if (Vmdata.Modeval == "Checkvmstatus")
            {
                Log.Info("Checkvmstatus");
                hs.Checkvmstatus();
            }
            //Stop Vm
            else if (Vmdata.Modeval == "Stopvm")
            {
                hs.Stopvm();
            }
            //GetAllvm's-Add
            else if(Vmdata.Modeval=="ShowAllvm")
            {
                hs.GetAllvm();
            }
        }