当前位置: 动力学知识库 > 问答 > 编程问答 >

softlayer - Error while capturing flex image

问题描述:

I am running following code.

`

RestApiClient client = new RestApiClient(baseUrl).withCredentials(userName, apiKey);

Account.Service service = Account.service(client);

service.withMask().hardware();

service.withMask().hardware().fullyQualifiedDomainName();

service.withMask().hardware().id();

Account account = service.getObject();

String hwname="bmtest.domain.com";

Hardware hw1=null;

for(Hardware h : account.getHardware()){

if(h.getFullyQualifiedDomainName().equalsIgnoreCase(hwname)) {

hw1 = h; }

}

Hardware.Service svc= Hardware.service(client);

svc=hw1.asService(client);

try{ Template template = new Template();

template.setName(hw1.getFullyQualifiedDomainName()+"-HWImg-1");

template.setDescription("Image of "+hw1.getFullyQualifiedDomainName());

System.out.println("Starting Image capture");

svc.captureImage(template);`

But get the following error:

`Starting Image capture

com.softlayer.api.ApiException$Internal: Failed to determine the version of the operating system running on bmtest3rhel6.domain.com via SSH. Please ensure that a firewall is not restricting access to port 22, that your SSH server's configuration allows root login, and that the root credentials we have on file are valid. You can verify and update these credentials in the <i>Software</i> section of <a href="/Hardware/view/385236">your server's page</a>.(code: SoftLayer_Exception_Public, status: 500)

at com.softlayer.api.ApiException.fromError(ApiException.java:16)

at com.softlayer.api.RestApiClient$ServiceProxy.logAndHandleResponse(RestApiClient.java:258)

at com.softlayer.api.RestApiClient$ServiceProxy.invokeService(RestApiClient.java:300)

at com.softlayer.api.RestApiClient$ServiceProxy.invoke(RestApiClient.java:466)

at com.sun.proxy.$Proxy7.captureImage(Unknown Source)

at com.ibm.adn.servlet.TestBMSuspend.test(TestBMSuspend.java:91)

at com.ibm.adn.servlet.TestBMSuspend.main(TestBMSuspend.java:103)

`

This particular baremetal is up and running. and I can log inside it using root, also opened the ports 22 ssh.

Still the same error repeats.

The baremetal has RHEL 6.7 , which as mentioned on SL site, is eligible for flex image capture.

Please let me know any additional things i should do to make this work.

网友答案:

I reviewed the code and it's working fine.

One thing that you could review is check if you're using a username and api key that has access to your hardware.

Check if you're allowed to take a flex image with your user in control portal, and if it's possible, then run your script with the same user credentials (i.e. username and api key).

If anything of these advises doesn't work, I suggest you to open a ticket on SoftLayer for further assistance.

分享给朋友:
您可能感兴趣的文章:
随机阅读: