def hdd_detach(uuid, controller_name, port, device):
try:
VBoxManage('storageattach', uuid, '--storagectl', controller_name,
'--port', port, '--device', device, '--type', 'hdd',
'--medium', 'none')
except ErrorReturnCode_1 as e:
# if the VM was not found
if 'VBOX_E_OBJECT_NOT_FOUND' in e.stderr:
raise HDDNotFound(uuid)
# something else happened, just let it go
raise
评论列表
文章目录