in this video I'm gonna show you how to use the redeploy tool in Azure hello
everyone my name is Travis and this is Ciraltos in this video I'm gonna show
you how to troubleshoot Azure VMs issues using the redeploy tool
understanding redeploy is listed as a requirement for the AZ-103 exam under
deployed manage Azure VMs but even if you're not interested in certification
this tool is extremely helpful in administrating and troubleshooting VM
issues there's not a lot of information on the redeploy tool from Microsoft the
documentation simply states that if you're having problems connecting to a
VM use redeploy there's a little bit more to it than that
before we get into that please take a second to subscribe to this channel and
click the bell icon to get updates when new content is posted it's super easy
just hit that red button below back to redeploy the Microsoft documentation
states that redeploy moves the VM to a new host that is correct when the
redeploy operation is ran the state of the VM is captured the current VM is
shut down and removed from the host the virtual disks however are left in place
the VM is recreated on another host with the same settings and disks once created
the VM is power back on note that the VM is shut down during the redeploy also
any dynamically assigned IPs will potentially change Azure has no VM
migration tools such as Vmotion in VMware the VM is tied to a host until
one or two things happen if the host fells the VM will be reprovisioned on a
new host within a certain amount of time I've heard that that's ten minutes but
that's unofficial the other time the VM will move is with
redeploy with that let's do a redeploy this is going to be a quick demo I'll do
it once for a Windows VM through the portal and again for a Linux VM using
PowerShell the VM needs to be powered on not in the powered off or deallocated
state to run redeploy okay buckle up everyone it's demo time so I'm going to
start out in the portal and here I'm going to do a redeploy first with test
VM one here that is a Windows 2019 I think anyway Windows nonetheless
to do the redeploy fairly simple all I do is go into the VM and towards the
bottom there's some troubleshooting support and troubleshooting and you can
see the hammer here redeploy click that and click redeploy that starts the
process and if we give it a few minutes it will finish I can go up here and look
at the overview last time I did this it took about 15-20 minutes to finish and
other times I've done it it's taken 10 so there's no real good indication of
how long this is gonna take while we're waiting for that let's move on to the
second VM which is a Linux VM for that I'm going to open up the cloud shell
this is really a handy tool for running commands in Azure it integrates
PowerShell directly into the portal and you don't have to sign in or
authenticate in order to get access in order to do the redeploy I'm going to
run the set-azureRMVM or Set-AZVM
next I'm going to add the resource group and tab to complete doesn't work with this
next I specify the name
and last I give it the redeploy option this command is gonna run redeploy
against that VM I'll cut here and come back in a couple
minutes when things have finished I'm back and it looks like things have
finished so here I've got a report that the operation for test02 was completed
successfully I'm gonna close the cloud shell and hop back over to the portal so
we can see a little bit more here we are back at the portal for 01 and really
there's not a good way to tell that it finished other than if we go into the
activity logs here you can see I've done it a couple times but the most recent
one redeploy it gives when it's started and that it's succeeded so that's a good
indication that this has been redeployed that's it for the demo that's how you
redeploy a VM through the portal through PowerShell and verify that the redeploy
has finished through the activity logs cool redeploy isn't really a way of
fixing a VM as much as it's a way of moving the VM to another host if that
host may be having issues the issues could prevent access to the VM or other
odd behavior I had a VM once with an issue where it
randomly rebooted it turned out to be an underlying host issue and the solution
was redeploy as your services are very reliable but if they're odd or not so
obvious issues a redeploy may be a good next step that leads to the question if
there are odd issues with a VM when do you do the redeploy my recommendation is
to do it early in the troubleshooting process providing the downtime is
acceptable this will rule out any underlying host issues that you're
troubleshooting tools may not be able to identify I hope you found this useful
please don't forget to subscribe and click the Bell icon to get notifications
of new content thanks for watching