What's up guys this is Bernardo from the BTNHD. And yes, today is all about downloading Azure
VM and then optimizing that basically virtual hard disk. Yeah, right. Alright, let's get
started. Alright, so to get started, we need to open up your favorite browser, my is Chrome.
So I am going to go inside the URL text box and type in portal.azure.com. Hit enter. It's
going to take me here, I'm going to put my email address hit next, it's going to want
my password I'm going to enter my password and then sign in and you should have this
as your Azure Portal. Now on your left hand side, we need to locate virtual machines.
And you're going to see all your virtual machines that you have within your Azure Portal. Now
the one that I am going to export so I can optimize and then use it within my Hyper-V
environment locally within my lab, I'm going to pick the vVPN and then from here we need
to get inside settings. Within settings, we are going to pick disk. Now within disk, I
am going to select my VPN disk. And it's going to take me here, right? And then we need to
go inside the following disk export. How easy is that? Now the URL by default is 3600 seconds.
So make sure you change it. So the URL will not expire on you. Because again, you're downloading
a huge container. Now this VPN is around 127 gigs. That's how big the virtual hard disk
is. And so I need to increase that URL. And this I'm going to give it 36,000 seconds and
then once you give it click on generate the URL, and on the upper right corner, you're
going to see it's generating the URL. once it's completed, it's going to take you to
this. This is the URL that you are able to copy and paste it to your favorite browser.
It's going to start downloading the VHD file locally to your machine. Now, taking consideration
that this VHD is good going to be huge. Like I said before, mine is 127 gigs. So make sure
that your local machine that you're downloading this virtual hard disk has enough space. So
I'm going to click on download this VHD file. And because I'm using Chrome on the lower
left hand side, you're going to see that is downloading it, say seven hours. And for me,
I had a couple problems because the download failed. Don't freak out, just click on the
little arrow and just say resume, eventually, it's gonna download and complete, you're able
to click on that little arrow and say show in folder, and there goes our hundred and
27 plus vhd file. Now, we are going to go to our start menu, and we're going to type
in Windows PowerShell. You can do it within a Windows PowerShell commandlet , but I like
to use the Windows PowerShell ISE, and I'm going to right click on that and run it as
an administrator. Hit yes on the User Account Control. And the first command that we need
to run is the following. Now I did my research within the Microsoft website, it told me to
run this. I ran it, but I got, you know, a couple of issues right here. And the way that
I fixed it was running the same command, right, which is enable windows optional features
with a parameter of dash online with another parameter of dash feature name, Microsoft
Hyper V management PowerShell, right, with all dashes in between all those words, but
the way that I got it to work is I had to add an additional parameter of dash all ran
it again, it worked with no problem and it wanted me to restart my machine so I hit Yes,
it started restarting and then boom, logged back into my machine. Open up Windows PowerShell
ISE as an administrator, I went inside my downloads folder because I wanted to make
sure the correct name of that virtual hard disk that I downloaded, went back inside my
PowerShell and I ran the following command line because 127 gigs is huge. You don't really
need that. S o we need to optimize it to the point that we are able to use it within
our Hyper-V local environment. So I ran the following which was optimized dash VHD with
a parameter of dash path and the location of where that VHD file that I downloaded which
was inside the downloads, and another parameter of dash mode and what type of mode now I did
it full and I ran it, it started compacting the virtual disk and once it's completed,
you're done. Now my results with optimizing the VHD which was 127 gigs, I got it up to
with this particular mode full, and this command optimize vhd I think I got it up to maybe
100 gigs, which is a big difference between 127 gigs to 100 so that's really big. So hopefully
you guys enjoy this video if you are optimizing your VHD files were command line are you using
also leave comments below if you are downloading or uploading VHD files to your Azure Portal
Don't forget to by hitting that like button also hit that subscribe button punch it, squeezes,
smash it, do whatever you need to do to hit that subscribe button, and I'll catch you
guys on the next one. Peace out!