Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/oop/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python Softlayer Got";“对等端重置连接”;捕获VM映像时出错_Python_Ibm Cloud Infrastructure - Fatal编程技术网

Python Softlayer Got";“对等端重置连接”;捕获VM映像时出错

Python Softlayer Got";“对等端重置连接”;捕获VM映像时出错,python,ibm-cloud-infrastructure,Python,Ibm Cloud Infrastructure,我使用Softlayer python API自动创建虚拟机,并在虚拟机上安装一些软件包,然后捕获虚拟机映像。该准则在过去三年中一直有效。代码在Softlayer内部的VM中运行。但是,从昨天开始,我一直在运行相同的代码时,在图像捕获过程中得到“由对等方重置连接”。只是想知道是不是Softlayer中有什么变化导致了它 错误:[Errno 104]对等方重置连接 2017-03-31 14:37:03096-imaginator.cli-Status-错误-失败| 生成映像期间发生未知错误-有关

我使用Softlayer python API自动创建虚拟机,并在虚拟机上安装一些软件包,然后捕获虚拟机映像。该准则在过去三年中一直有效。代码在Softlayer内部的VM中运行。但是,从昨天开始,我一直在运行相同的代码时,在图像捕获过程中得到“由对等方重置连接”。只是想知道是不是Softlayer中有什么变化导致了它

错误:[Errno 104]对等方重置连接

2017-03-31 14:37:03096-imaginator.cli-Status-错误-失败| 生成映像期间发生未知错误-有关详细信息,请参阅日志

2017-03-31 14:37:03097-SoftLayer.transports-INFO-POST

2017-03-31 14:37:03097-urllib3.connectionpool-INFO-Starting new HTTPS连接(1):api.service.softlayer.com

2017-03-31 14:37:05719-imaginator.provider.softlayer-信息- 已提交销毁实例30219065的请求


我用来捕获图像的代码是:

transactionInfo = self.client['Virtual_Guest'].createArchiveTransaction(name, disks, groupName, id=server.id)

您使用的代码行是正确的。该方法按预期工作,我能够使用下面的代码示例创建图像模板

目前,Softlayer的API服务器中存在一些与“对等方重置连接”相关的问题,Softlayer正在努力解决这些问题。一些用户报告这是暂时的,我建议过一会儿再试一次

代码示例:

"""
Create image template.

The script creates a standard image template, it makes a call to the SoftLayer_Virtual_Guest::createArchiveTransaction method
sending the IDs of the disks in the request.
For more information please see below.

Important manual pages:
https://sldn.softlayer.com/reference/services/SoftLayer_Virtual_Guest
https://sldn.softlayer.com/reference/services/SoftLayer_Virtual_Guest/createArchiveTransaction
https://sldn.softlayer.com/reference/datatypes/SoftLayer_Virtual_Guest_Block_Device

License: http://sldn.softlayer.com/article/License
Author: SoftLayer Technologies, Inc. <sldn@softlayer.com>
"""
import SoftLayer

# Your SoftLayer API username and key.
USERNAME = 'set me'
API_KEY = 'set me'

# The virtual guest ID you want to create a template
virtualGuestId = 29292929
# The name of the image template
groupName = 'my image name'
# An optional note for the image template
note = 'an optional note'

"""
Build a skeleton SoftLayer_Virtual_Guest_Block_Device object
containing the disks you want to the image.
In this case we are going take an image template of 2 disks
from the virtual machine.
"""
blockDevices = [
    {
        "id": 45009433,
        "complexType": "SoftLayer_Virtual_Guest_Block_Device"
    },
    {
        "id": 45009439,
        "complexType": "SoftLayer_Virtual_Guest_Block_Device"
    }
]

# Declare a new API service object
client = SoftLayer.create_client_from_env(username=USERNAME, api_key=API_KEY)

try:
    # Creating the transaction for the image template
   response = client['SoftLayer_Virtual_Guest'].createArchiveTransaction(groupName, blockDevices, note, id=virtualGuestId)
    print(response)
except SoftLayer.SoftLayerAPIError as e:
    """
    # If there was an error returned from the SoftLayer API then bomb out with the
    # error message.
    """
    print("Unable to create the image template. faultCode=%s, faultString=%s" % (e.faultCode, e.faultString))   
“”“
创建图像模板。
该脚本创建一个标准图像模板,它调用SoftLayer_Virtual_Guest::createArchiveTransaction方法
发送请求中磁盘的ID。
有关更多信息,请参见下文。
重要手册页:
https://sldn.softlayer.com/reference/services/SoftLayer_Virtual_Guest
https://sldn.softlayer.com/reference/services/SoftLayer_Virtual_Guest/createArchiveTransaction
https://sldn.softlayer.com/reference/datatypes/SoftLayer_Virtual_Guest_Block_Device
许可证:http://sldn.softlayer.com/article/License
作者:SoftLayer Technologies,Inc。
"""
导入软层
#您的SoftLayer API用户名和密钥。
用户名='设置我'
API_KEY='设置我'
#要创建模板的虚拟来宾ID
virtualGuestId=2929
#图像模板的名称
groupName='我的图像名称'
#图像模板的可选注释
备注='可选备注'
"""
构建骨架软层\虚拟\来宾\块\设备对象
包含要添加到映像中的磁盘。
在本例中,我们将使用两个磁盘的映像模板
从虚拟机。
"""
块设备=[
{
“id”:45009433,
“complexType”:“软层\虚拟\来宾\块\设备”
},
{
“id”:45009439,
“complexType”:“软层\虚拟\来宾\块\设备”
}
]
#声明一个新的API服务对象
客户端=软件层。从环境创建客户端(用户名=用户名,api密钥=api密钥)
尝试:
#为图像模板创建事务
response=client['SoftLayer\u Virtual\u Guest'].createArchiveTransaction(组名,blockDevices,注意,id=virtualGuestId)
打印(答复)
除SoftLayer.SoftLayer外,错误为e:
"""
#如果SoftLayer API返回错误,则使用
#错误消息。
"""
打印(“无法创建图像模板。faultCode=%s,faultString=%s”%(e.faultCode,e.faultString))

关于,

我用于捕获映像的代码如下:transactionInfo=self.client['Virtual_Guest'].createArchiveTransaction(名称、磁盘、组名、id=server.id)