padulka
Hot Shot
Hot Shot

Automate Upgrade Esxi without vCenter

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

Labels (1)
Tags (1)
0 Kudos
8 Replies
LucD
Leadership
Leadership

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.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
padulka
Hot Shot
Hot Shot

Hi LucD,

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

0 Kudos
LucD
Leadership
Leadership

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


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
padulka
Hot Shot
Hot Shot

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

0 Kudos
LucD
Leadership
Leadership

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.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

padulka
Hot Shot
Hot Shot

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

 

0 Kudos
LucD
Leadership
Leadership

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.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
padulka
Hot Shot
Hot Shot

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.

0 Kudos