vmware/pyvmomi-community-samples

How to get stdout and stderr or console log when I created a VM.

Open

#670 geöffnet am 29. Juni 2021

Auf GitHub ansehen
 (0 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Python (914 Forks)batch import
help wanted

Repository-Metriken

Stars
 (972 Stars)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

Hot to get installing VM's stdout and stderr or console log when I created a VM with pyvmomi. I want to check if the VM install successfully and get the error when it's failed.

from pyVim.connect import Disconnect, SmartConnectNoSSL
from pyVmomi import vim, vmodl

vw.create_vm('vm_name', mac_address=mac_address, mem=2024, cpu=1, guest_id="rhel6_64Guest", version="vmx-11",
         ip="10.1.110.188")
vm = get_obj(vw.content, [vim.VirtualMachine], 'vm_name')
power(vm, "on")  # power on

# How to do??
stdout = "" 
stderr = ""
install_log = ""

Contributor Guide