使用Softlayer cli或web门户在Softlayer中调配VM后,调配后脚本不会下载到VM中。是否有可以打开的调试标志,以排除将配置后脚本下载到虚拟机的故障?
c:/PostScript文件夹仅在VM ithBuildINI、postscript和wget文件上创建。
有什么想法吗?
发布于 2017-04-20 06:57:21
首先验证postscript的URL是否已经存在,如果您的postscript已在其他环境中成功下载,我建议您提交工单以进行审核。
无法知道下载失败的时间,它由服务器在VM资源调配期间处理。
有两个选项可以重复下载过程:
a)通过执行 方法
如果成功,则返回NULL;如果失败,则返回如下异常:
Script download failed. Could not confirm file downloaded correctly.该脚本直接在单元C中下载,还有一个名为postInstallScript_Download.txt的日志文件。在VSI资源调配之后使用此方法(当它处于打开状态时)。您可以在python中使用以下示例来测试此方法。
"""
Download and run remote script from uri on virtual guests.
This returns NULL when success and an exception like this if fails:
"Script download failed. Could not confirm file downloaded correctly."
See below for more details.
Important manual pages:
http://sldn.softlayer.com/reference/services/SoftLayer_Virtual_Guest/executeRemoteScript
License: http://sldn.softlayer.com/article/License
Author: SoftLayer Technologies, Inc. <sldn@softlayer.com>
"""
import SoftLayer
USERNAME = 'set me'
API_KEY = 'set me'
# The virtual guest ID.
guestId = 31003555
# Declares a new API service object.
client = SoftLayer.create_client_from_env(username=USERNAME, api_key=API_KEY)
virtualGuestService = client['SoftLayer_Virtual_Guest']
# URL where is hosted the script you want to download.
uri = "http://www.example.com/test_container/folder/startNotepad.cmd"
try:
result = virtualGuestService.executeRemoteScript(uri, id=guestId)
print("File was downloaded!!")
except SoftLayer.SoftLayerAPIError as e:
print("Error: %s, %s" % (e.faultCode, e.faultString))
exit(1)使用您自己的数据更改31003555和。
b)通过web门户或cli重新加载操作系统
我建议您使用门户网站,您只需设置postscript url,服务将自动设置以前的配置,如操作系统、防火墙等。
考虑到重新加载将格式化主盘并将计算实例重新配置为记录规格。在这种情况下,也无法知道下载过程何时失败。
您可以在此处找到有关如何进行重新加载和添加后处理脚本的信息:https://knowledgelayer.softlayer.com/procedure/perform-os-reload https://knowledgelayer.softlayer.com/procedure/os-reloads
您还可以查看:
https://knowledgelayer.softlayer.com/procedure/add-custom-provisioning-script https://knowledgelayer.softlayer.com/procedure/add-provisioning-script https://knowledgelayer.softlayer.com/faq/what-difference-between-using-http-or-https-url-my-provisioning-script
我希望这对你有帮助。
致以问候。
https://stackoverflow.com/questions/43504280
复制相似问题