mirror of
https://github.com/vmware/vsphere-automation-sdk-python.git
synced 2024-11-21 17:29:59 -05:00
Remove the output file before creating new serial port
When re-run the sample without cleanup previous port the power on peration may time out due to the output file exist already. Remove the file before creating new port and add notes to help avoiding this. Signed-off-by: Tianhao He <tianhao64@users.noreply.github.com>
This commit is contained in:
parent
6847135029
commit
43c25d0b61
@ -35,6 +35,15 @@ Demonstrates how to configure Serial ports for a VM.
|
||||
|
||||
Sample Prerequisites:
|
||||
The sample needs an existing VM.
|
||||
|
||||
Note:
|
||||
The sample adds new serial ports to the existing VM. If you re-run the sample
|
||||
without cleaning up the previous created serial ports, the VM may be stuck at
|
||||
power on stage as there will be multiple serial ports using the same output
|
||||
file. In such case, you will see a question in vCenter UI asking if the file
|
||||
should be Replaced or Appended.
|
||||
To avoid this, make sure to pass -c to clean up the serial ports or manually
|
||||
delete them after running the sample.
|
||||
"""
|
||||
|
||||
vm = None
|
||||
@ -122,6 +131,9 @@ def run():
|
||||
print('vm.hardware.Serial.get({}, {}) -> {}'.
|
||||
format(vm, serial, pp(serial_info)))
|
||||
|
||||
# Make sure output file doesn't exist already
|
||||
cleanup_backends()
|
||||
|
||||
print('\n# Example: Create Serial port with FILE backing')
|
||||
serial_port_datastore_path = testbed.config['SERIAL_PORT_DATASTORE_PATH']
|
||||
serial_create_spec = Serial.CreateSpec(
|
||||
|
Loading…
Reference in New Issue
Block a user