public override void Cleanup()
        {
            // detach the Tag from the Cluster
            if (this.tagAttached)
            {
                this.tagAssociation.Detach(tagId, this.clusterId);
                Console.WriteLine("Cluster '{0}' untagged", ClusterName);
            }

            // delete the tag
            if (this.tagId != null)
            {
                this.tagService.Delete(this.tagId);
                Console.WriteLine("Deleted tag '{0}'", this.tagName);
            }


            // delete the category
            if (this.categoryId != null)
            {
                this.categoryService.Delete(categoryId);
                Console.WriteLine("Deleted category '{0}'", this.categoryName);
            }
            VapiAuthHelper.Logout();
        }
        public override void Cleanup()
        {
            PowerTypes.Info powerInfo = this.powerService.Get(this.vmId);
            if (powerInfo.GetState().Equals(PowerTypes.State.POWERED_ON))
            {
                Console.WriteLine("\n\n#### Cleanup: Powering off the VM");
                this.powerService.Stop(this.vmId);
            }

            if (this.sataId != null)
            {
                Console.WriteLine("\n\n#### Cleanup: Deleting the SATA "
                                  + "controller");
                this.sataService.Delete(this.vmId, this.sataId);
            }

            Console.WriteLine("\n\n#### Cleanup: Deleting all the created"
                              + " CD-ROMs");
            foreach (String cdromId in createdCdroms)
            {
                this.cdromService.Delete(this.vmId, cdromId);
            }
            ListAllCdroms();
            VapiAuthHelper.Logout();
        }
        public override void Cleanup()
        {
            if (this.powerService.Get(this.vmId).GetState().Equals(
                    PowerTypes.State.POWERED_ON))
            {
                Console.WriteLine("Power off the vm");
                this.powerService.Stop(this.vmId);
            }

            // List all ethernet adapters of the virtual machine
            List <EthernetTypes.Summary> nicSummaries =
                this.ethernetService.List(this.vmId);

            nicSummaries.ForEach(i => Console.WriteLine(i));

            Console.WriteLine("\n\n#### Cleanup: Delete all the created "
                              + "Ethernet NICs.");
            foreach (string nicId in createdNics)
            {
                this.ethernetService.Delete(this.vmId, nicId);
            }
            nicSummaries = this.ethernetService.List(this.vmId);
            nicSummaries.ForEach(i => Console.WriteLine(i));
            VapiAuthHelper.Logout();
        }
 public override void Cleanup()
 {
     if (this.exhaustiveVMId != null)
     {
         this.vmService.Delete(this.exhaustiveVMId);
     }
     VapiAuthHelper.Logout();
 }
 public override void Cleanup()
 {
     if (this.basicVmId != null)
     {
         this.vmService.Delete(this.basicVmId);
     }
     VapiAuthHelper.Logout();
 }
        public override void Cleanup()
        {
            Console.WriteLine("\n#### Cleanup: Revert boot device "
                              + "configuration");
            this.bootDeviceService.Set(this.vmId,
                                       this.orginalBootDeviceEntries);
            List <DeviceTypes.Entry> bootDeviceEntries =
                this.bootDeviceService.Get(this.vmId);

            bootDeviceEntries.ForEach(i => Console.WriteLine(i));
            VapiAuthHelper.Logout();
        }
Esempio n. 7
0
 public override void Cleanup()
 {
     Console.WriteLine("\n\n#### Cleanup:Revert memory configuration.");
     MemoryTypes.UpdateSpec memoryUpdateSpec =
         new MemoryTypes.UpdateSpec();
     memoryUpdateSpec.SetHotAddEnabled(
         this.originalMemoryInfo.GetHotAddEnabled());
     memoryUpdateSpec.SetSizeMiB(this.originalMemoryInfo.GetSizeMiB());
     Console.WriteLine(memoryUpdateSpec);
     MemoryTypes.Info memoryInfo = memoryService.Get(this.vmId);
     Console.WriteLine(memoryInfo);
     VapiAuthHelper.Logout();
 }
        public override void Cleanup()
        {
            Console.WriteLine("\n\n#### Cleanup: Deleting all adapters that "
                              + "were created");
            foreach (string sataId in createdSataAdapters)
            {
                this.sataService.Delete(this.vmId, sataId);
            }
            Console.WriteLine("\n\n#### List all SATA adapters on the VM");
            List <SataTypes.Summary> sataSummaries =
                this.sataService.List(this.vmId);

            sataSummaries.ForEach(i => Console.WriteLine(i));
            VapiAuthHelper.Logout();
        }
Esempio n. 9
0
 public override void Cleanup()
 {
     Console.WriteLine("\n\n### Cleanup: Revert the CPU configuration");
     CpuTypes.UpdateSpec cpuUpdateSpec = new CpuTypes.UpdateSpec();
     cpuUpdateSpec.SetCoresPerSocket(
         this.originalCpuInfo.GetCoresPerSocket());
     cpuUpdateSpec.SetCount(this.originalCpuInfo.GetCount());
     cpuUpdateSpec.SetHotAddEnabled(
         this.originalCpuInfo.GetHotAddEnabled());
     cpuUpdateSpec.SetHotRemoveEnabled(
         this.originalCpuInfo.GetHotRemoveEnabled());
     cpuService.Update(this.vmId, cpuUpdateSpec);
     Console.WriteLine(cpuUpdateSpec);
     CpuTypes.Info cpuInfo = cpuService.Get(this.vmId);
     Console.WriteLine("VM ID = " + this.vmId);
     Console.WriteLine(cpuInfo);
     VapiAuthHelper.Logout();
 }
 public override void Cleanup()
 {
     Console.WriteLine("\n\n#### Cleanup: Revert the boot "
                       + "configuration");
     BootTypes.UpdateSpec bootUpdateSpec =
         new BootTypes.UpdateSpec();
     bootUpdateSpec.SetDelay(this.originalBootInfo.GetDelay());
     bootUpdateSpec.SetEfiLegacyBoot(
         this.originalBootInfo.GetEfiLegacyBoot());
     bootUpdateSpec.SetEnterSetupMode(
         this.originalBootInfo.GetEnterSetupMode());
     bootUpdateSpec.SetNetworkProtocol(
         this.originalBootInfo.GetNetworkProtocol());
     bootUpdateSpec.SetRetry(this.originalBootInfo.GetRetry());
     bootUpdateSpec.SetRetryDelay(
         this.originalBootInfo.GetRetryDelay());
     bootUpdateSpec.SetType(this.originalBootInfo.Get_Type());
     this.bootService.Update(this.vmId, bootUpdateSpec);
     BootTypes.Info bootInfo = this.bootService.Get(this.vmId);
     Console.WriteLine(bootInfo);
     VapiAuthHelper.Logout();
 }
 public override void Cleanup()
 {
     VapiAuthHelper.Logout();
 }