/// <summary> /// Create a profile from the specified CreateSpec.HostProfileHostBasedConfigSpec is /// created from the hostEntitymoref(create_host_entity_name) reference. Using /// this spec a hostProfile is created. /// </summary> /// <param name="hostmor">ManagedObjectReference</param> /// <param name="hostName">string</param> /// <returns>ManagedObjectReference</returns> private ManagedObjectReference CreateHostProfile(ManagedObjectReference hostmor, string hostName) { HostProfileHostBasedConfigSpec hostProfileHostBasedConfigSpec = new HostProfileHostBasedConfigSpec(); hostProfileHostBasedConfigSpec.host = hostmor; hostProfileHostBasedConfigSpec.annotation = "SDK Sample Host Profile"; hostProfileHostBasedConfigSpec.enabled = false; hostProfileHostBasedConfigSpec.enabledSpecified = true; hostProfileHostBasedConfigSpec.name = "SDK Profile3w43" + hostName; Console.WriteLine("--------------------"); Console.WriteLine("* Creating Host Profile"); Console.WriteLine("--------------------"); ManagedObjectReference hostProfile = cb._connection._service.CreateProfile(hostprofileManager, hostProfileHostBasedConfigSpec); Console.WriteLine("Profile : " + hostProfile.Value); Console.WriteLine("Host : " + hostmor.Value); return(hostProfile); }
/// <summary> /// Create a profile from the specified CreateSpec.HostProfileHostBasedConfigSpec is /// created from the hostEntitymoref(create_host_entity_name) reference. Using /// this spec a hostProfile is created. /// </summary> /// <param name="hostmor">ManagedObjectReference</param> /// <param name="hostName">string</param> /// <returns>ManagedObjectReference</returns> private ManagedObjectReference CreateHostProfile(ManagedObjectReference hostmor, string hostName) { HostProfileHostBasedConfigSpec hostProfileHostBasedConfigSpec = new HostProfileHostBasedConfigSpec(); hostProfileHostBasedConfigSpec.host = hostmor; hostProfileHostBasedConfigSpec.annotation = "SDK Sample Host Profile"; hostProfileHostBasedConfigSpec.enabled = false; hostProfileHostBasedConfigSpec.enabledSpecified = true; hostProfileHostBasedConfigSpec.name = "SDK Profile3w43" + hostName; Console.WriteLine("--------------------"); Console.WriteLine("* Creating Host Profile"); Console.WriteLine("--------------------"); ManagedObjectReference hostProfile = cb._connection._service.CreateProfile(hostprofileManager, hostProfileHostBasedConfigSpec); Console.WriteLine("Profile : " + hostProfile.Value); Console.WriteLine("Host : " + hostmor.Value); return hostProfile; }