How to set CPU number and its cores when I create a Virtual Server

130 views Asked by At

I've used SoftLayer Java API to create Virtual Server and want to set CPU number and core number. I know hardware have have "processorCoreAmount" could be set core number, and here is part of my code:

Guest guest = new Guest();
guest.setHostname("host-" + RandomStringUtils.randomAlphanumeric(5).toLowerCase());
guest.setDomain(t.getDatacenter() + ".softlayer.com");
guest.setStartCpus(2);
guest.setMaxCpuUnits(4); 
**guest.setProcessorCoreAmount(4);** // no such a method.

My question:

  1. How to set Processor Core Amount in Virtual Server?
  2. Does MaxCpuUnits could be limit the Max CPU number or Max Core number of each CPU?
1

There are 1 answers

9
Nelson Raul Cabero Mendoza On BEST ANSWER

In a order you can oly can set the "StartCpus" property see: http://sldn.softlayer.com/reference/services/SoftLayer_Virtual_Guest/createObject

only the vales displayed in documentation can be set.

Also you can get all the avialable proccessor for order by calling the method:

http://sldn.softlayer.com/reference/services/SoftLayer_Virtual_Guest/getCreateObjectOptions

Regards