Power cycling compute blades via UCS Central Python SDK

Recently I am preparing an installation automation for our new Cisco UCS environment which will consist of multiple UCS domains in the near future. As one of the steps, I was trying to power cycle our compute blades via UCS Central Python SDK. Methods are similar to the ones in UCS Manager SDK but separately developed:

srv_obj = handle.query_dn(srv_dn)
srv_obj.admin_power = "cycle-immediate"
handle.set_mo(srv_obj)
handle.commit()

Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python3.6/site-packages/ucscsdk-0.9.0.1-py3.6.egg/ucscsdk/ucschandle.py", line 716, in commit
raise UcscException(response.error_code, response.error_descr)
ucscsdk.ucscexception.UcscException: [ErrorCode]: 170[ErrorDescription]: Config server power state via Service Profile is not allowed. Please use server operations to perform power operations.

Apparently the feature was disabled in UCS Central API as the solution to a previous bug that prematurely resets blades: https://quickview.cloudapps.cisco.com/quickview/bug/CSCvp40200

I decided to implement it by finding out the domain information of the blade and triggering a power cycle through directly UCS Manager API instead.

Windows 10 1903 update vs VMware Workstation 12+

Windows 10 build version 1903 (19H1) comes with a Sandbox feature which relies on Hyper-V technology. If you have already installed VMware Workstation version 12 and above before the Windows 10 1903 update, the system gives an error about installing the latest updates and offer you to remove it to proceed with the update.

If you want to keep VMware Workstation solution is easy with a workaround. First you should uninstall VMware Workstation preferably without removing application settings and license information. After the Windows update installation you should first enable the Hyper-V related features under “Setting -> Apps -> Apps & features -> Programs & Features -> Turn Windows features on or off” for some cases that they are partially enabled. The system will prompt for reboot and after the reboot you should disable these features back not to conflict with VMware Workstation any more.

You can install VMware Workstation back after the final reboot and continue to use your old VMs as before.

Windows Sandbox Features

To speed up the boot sequence I prefer to keep the related VMware services startup type manual and control them with a PowerShell script below:

VMware Workstation Windows services
Enable-NetAdapter VMware* -Confirm:$false
Start-Service "VMware Authorization Service"
Start-Service "VMware USB Arbitration Service"
Start-Service "VMware NAT Service"
Start-Service "VMware DHCP Service"
Start-Service "VMware Workstation Server"
Start-Process -NoNewWindow -Wait "C:\Program Files (x86)\VMware\VMware Workstation\vmware.exe"
Stop-Service "VMware Workstation Server"
Stop-Service "VMware DHCP Service"
Stop-Service "VMware NAT Service"
Stop-Service -Force "VMware USB Arbitration Service"
Stop-Service -Force "VMware Authorization Service"
Disable-NetAdapter VMware* -Confirm:$false

Then you can change the default VMware Workstation shortcut target to run this PowerShell script:

%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -WindowStyle Hidden -File "[full_path_to_your_script]"

My website uses cookies. Click for more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close