0
votes

After VM provisioning in Softlayer using Softlayer cli or web portal, post provisioning script does not get downloaded into VM. Is there a debug flag that can be turned on to troubleshoot downloading post provisioning script into VM?

c:/PostScript folder gets created on the VM ithBuildINI, postscript and wget files only.

Any idea?

1

1 Answers

0
votes

First verify that URL of postscript already exists, if your postscript was successfully downloaded in another environment I recommend to submit a ticket in order to review it.

There is no way to know when download fails, it is handled by the server during VM provisioning.

There are two options to repeat the download process:

a) By executing the method SoftLayer_Virtual_Guest::executeRemoteScript

This returns NULL when success and an exception like this if fails:

Script download failed. Could not confirm file downloaded correctly.

The script is directly downloaded in unit C, and also there is a log file called postInstallScript_Download.txt. Use this method after VSI provisioning(when it is ON). You can use following example in python to test this method.

"""
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. <[email protected]>
"""

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)

Change 31003555 and http://www.example.com/test_container/folder/startNotepad.cmd with your own data.

b) By reloading the OS through web portal or cli

I recommend to use the web portal, you need only to set the postscript url and the service will automatically set previous configurations like operating system, firewall, etc.

Take account that reload will format the primary disk and will reconfigure the computing instance to the specifications on record. On this case, there is also no way to know when download process fails.

Here you can find information about how to made a reload and add a post-script: https://knowledgelayer.softlayer.com/procedure/perform-os-reload https://knowledgelayer.softlayer.com/procedure/os-reloads

Also you can review:
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

I hope this help you.

Regards.