Automation

 View Only
  • 1.  Automate Upgrade Esxi without vCenter

    Posted Jun 04, 2021 10:01 AM

    Hi to all,

    I'm trying to investigate to upgrade my hosts from 6.5 to 7.0 with only a partial connection to vCenter. 

    I explain my procedure:

    1. upload on local datastore offline bundle for upgrade
    2. put in maintenance the host with e specific VMs shutdown sequence; when the last VM is powered off I lose connection from vCenter to the host (it's a particular condition)
    3. I need to execute the script to upgrade the host without override the local disk, removing from maintenance and reboot to restart all VMs.

    Is it possible? I'm trying to find something about this

    Regards



  • 2.  RE: Automate Upgrade Esxi without vCenter

    Posted Jun 04, 2021 11:42 AM

    You can connect to the ESXi node with Connect-VIServer I assume?

    If yes, you can use Get-EsxCli and then run software vib install to do the upgrade from the bundle.



  • 3.  RE: Automate Upgrade Esxi without vCenter

    Posted Jun 04, 2021 12:59 PM

    Hi LucD,

    I lose any connection with host when, putting in maintenance, the last VM (that manage a sort of VPN) is powered off. 



  • 4.  RE: Automate Upgrade Esxi without vCenter

    Posted Jun 04, 2021 01:16 PM

    I'm not sure how you envisage updating the node without access?



  • 5.  RE: Automate Upgrade Esxi without vCenter

    Posted Jun 04, 2021 01:22 PM

    Correct LucD, this is my problem. I need to understand if there's a way to execute an "offline script" on esxi host



  • 6.  RE: Automate Upgrade Esxi without vCenter

    Posted Jun 04, 2021 02:00 PM

    The only option I can think of, not using a connection, is the method described KB2043564.

    But I'm not sure if that will work for an upgrade, nor has it anything to do with PowerCLI.



  • 7.  RE: Automate Upgrade Esxi without vCenter

    Posted Jun 10, 2021 01:07 PM

    Hi LucD I find some script to access throught SSH to execute update. Before I need to power-off VMs (no VMware Tools) and I'm using the following command:

    $VMsArray = @("VM01","VM02","VM03","VM04","VM05","VM06")

    foreach ($VM in $VMsArray) {

    Stop-VM -kill $VM -Confirm:$false

    $checkvm = "PoweredOn"

    while ($checkvm -eq "PoweredOn") {

    Start-Sleep 2

    $checkvm = (get-vm -Name $VM | select Powerstate).PowerState

    }

    }

    but go in loop on first VM.

    Thanks

     



  • 8.  RE: Automate Upgrade Esxi without vCenter

    Posted Jun 10, 2021 05:08 PM

    I have no clue what you are talking about.

    Also, amazed that now you seem to be able to do an SSH session, while you told earlier that you couldn't do that.



  • 9.  RE: Automate Upgrade Esxi without vCenter

    Posted Jun 10, 2021 06:32 PM

    Sorry LucD I have investigate and I find another way (with a different IP of different vLAN) to access to SSH with a custom port.

    The problem is that I cannot connect the host to vCenter with this ip.

    So I need to poweroff all VMs losing connection with vCenter and then connect throught SSH with a different ip and execute the update using esxcli command. To do this I have used plink.exe.