How to clone a USB flash drive containing ESXi operating system

Hi,
 
 I have a VMWare box running ESXi V6 and installed ESXi on an external USB flash drive. So everytime I reboot VMWare box, it needs this USB flash drive to load ESXi OS.
 How do I create a duplicate USB flash drive just in case it goes bad in the future?

Thanks.
LVL 1
sgleeAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dr. KlahnPrincipal Software EngineerCommented:
Buy an identical drive (this may not be strictly necessary, but it will forestall various problems).

Then image the drive using a pen drive imaging tool such as ImageUSB or USB Image Tool.

https://www.osforensics.com/tools/write-usb-images.html

http://www.alexpage.de/usb-image-tool/

Both of these tools also allow making an image of the USB drive to a file for safekeeping against future disaster.
0
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
There is a real issue now, with IMAGING USB flash drives, you need to ensure that the SIZE is identical!

and even if you purchase a 16GB flash drive, from the same vendor, we have found that are not the same size, and hence any image will not write correctly. (using those tools specified!).

The best and recommended method is to Backup the configuration of the host, and Restore the configuration of the host to a host with a new USB flash drive, after you have installed the correct ESXi build.

vicfg-cfgbackup --server=ESXi_host_IP_address --username=root -l backup_file

Open in new window


see here

https://kb.vmware.com/s/article/2042141

Or, you can also use this utility by Slymsoft which has a nice GUI

http://slymsoft.com/esxi-conf-backup/
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Dr. KlahnPrincipal Software EngineerCommented:
And that's why I said, and emphasized, "identical."
0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
and that's why I wrote

and even if you purchase a 16GB flash drive, from the same vendor, we have found that are not the same size, and hence any image will not write correctly. (using those tools specified!).

You cannot tell, when you purchase 2 x Kingston 16GB, the packaging states 16GB, but they vary by a few bits here and there are images are useless!

the image will not write, or will be short write, and ESXi will complain and not BOOT. (it's never been technically supported either, it was a good solution many years ago, but since ESXi moved to GPT, there are many issues!) I even wrote an EE Article once...

How to Backup an ESXi installation on an USB Flash Drive or SD card, for security or redundancy.

and if your configuration changes on the host ESXi USB flash drive, you are going to have to Power Off the server and try and image, Backup and Restore can be down with the server powered up!
0
sgleeAuthor Commented:
I will try both suggestions tomorrow and report back.
0
sgleeAuthor Commented:
Is it possible to move ESXi OS from an external usb flash drive to a local hard drive?
0
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
Is it possible to move ESXi OS from an external usb flash drive to a local hard drive?

it would take you longer that a reinstall!

No.

Why would you ?
0
sgleeAuthor Commented:
My experience with USB boot up method has been a mixed one. On the other hand, VMWare servers  loading ESX from local HD have never failed so far. Don’t need to create a duplicate USB either.
0
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
Just make sure you always have a backup of your ESXi configuration and you'll be fine.
0
sgleeAuthor Commented:
How do I backup ESXi configuration?
0
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
I posted the details in my firs and opening post! https:#a42502992 !

This is what you should be doing as part of regular Administration!
0
sgleeAuthor Commented:
@Dr. Klahn
I tried both USB Image Tool and ImageUSB software and both worked well  I thought that USB Image Tool was faster  than ImageUSB in both creating a backup and restoring from the backup.
I used 8GB USB Stick and took a long time to backup and restore as it was creating a 8GB image file instead of actual data size which was < 500MB.
If I had used 2GB, that would it have taken less time in backup and restore?
Is 2GB USB stick big enough in a typical configuration of ESXi? When do you ever go beyond 1GB of data?
0
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
If you look at specifications VMware still state minimum of 1GB or 2GB to use!
0
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
Still quicker to backup and restore ESXi configuration and supported!
0
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
If you had used a 2GB stick of course it's quicker less sectors to read and restore!

Less data!
0
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
Have you booted and used the restored sticks?
0
sgleeAuthor Commented:
"Have you booted and used the restored sticks?" --> Yes. Restored USB sticks worked well.
0
sgleeAuthor Commented:
"Still quicker to backup and restore ESXi configuration and supported!" --> I know that you provided the script "vicfg-cfgbackup --server=ESXi_host_IP_address --username=root -l backup_file". But where do you run that?
0
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
So how does you 8GB image work for a 2GB or 32GB stick if you do not have any 8GB sticks to hand?

You run it from Windows or Vma!

Install the software I linked to!
0
sgleeAuthor Commented:
@Andrew,
Are you referring to "http://slymsoft.com/esxi-conf-backup/"?
0
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
Yes

If you do not like command lines it's a GUI wrapper and you will still need the VMware download

What are you trying to avoid, and now you have a backup USB stick with ESXi, what happens in the future when you change

1. ESXi configuration ?
2. Patch Critical and Security Updates on ESXi ?

Will you shutdown your server, remove the USB stick, and backup again ?
0
sgleeAuthor Commented:
Configuration BackupI downloaded and installed vSphere Configuration Backup 2.1 and enter ESXi host IP address along with password.
When I clicked [SAVE] button, it opened the file in notepad and below is the contents.
Is this what I should expect?

**************************************
#!/usr/bin/perl -w
#
# Copyright 2008 VMware, Inc. All rights reserved.
#
use strict;
use warnings;
use Getopt::Long;

use VMware::VIRuntime;
use VMware::VILib;
use VMware::VIExt;
my %opts = (
   vihost => {
      alias => "h",
      type => "=s",
      help => qq!    The host to use when connecting via Virtual Center!,
      required => 0,
   },
);

Opts::add_options(%opts);

Opts::parse();
Util::connect();

my $host_view = VIExt::get_host_view(1, ['config.product.fullName', 'configManager.storageSystem']);
print $host_view->{'config.product.fullName'};;

Util::disconnect();
**************************************
0
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
You also need to install the components from VMware ?

Please click Settings ?
0
sgleeAuthor Commented:
SettingsHere it is:
0
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
Okay you are missing a VMware component, the VMware vCLI

https://my.vmware.com/web/vmware/details?downloadGroup=VCLI600&productId=491

make sure you download v6.0!
0
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
When you enter the FQDN of your ESXi server and hit Save, it should check and login, and tell you the version of ESXi in a pop up
0
sgleeAuthor Commented:
Connection Messagethis is all that is happening.
0
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
Yes, that's configured now, and it's found the vSphere vCLI you've installed.

did you read any of the notes, guide ?????

did you configure it all ? location of to store backups, settings retention etc

to backup you run vSphere Configuration Backup
0
sgleeAuthor Commented:
Configuration BackupWhen I ran vSphere Configuration Backup.exe, it created 2018-03-22.zip file in C:\vSphere-Backups folder.
When I tried to uncompress, it showed two files - 192.168.1.15.tar.gz and ESXi Versions.txt.
0
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
the tar.gz are your backups to restore!
0
sgleeAuthor Commented:
"the tar.gz are your backups to restore!" 00> Got it.
How do I restore this?

In case of duplicate USB sticks, I understand that if one USB stick is corrupted, you can stick in the backup USB stick.
When would I use tar.gz file?
0
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:

In case of duplicate USB sticks, I understand that if one USB stick is corrupted, you can stick in the backup USB stick.

not supported

it may work...but your backup USB stick is now out of date since you inserted the server USB stick back in the server!

if you've changed your configuration, and patched your ESXi host ? what do you do now ?

So are you not going to patch, update change any configuration on your host now, because your USB stick will be out of date!

e.g. you current host has not been patched for 12 months, and is old, and is behind by at least 7 updates, so how are you going to update your backup flash drive ?

You restore using the details in this URL

https://kb.vmware.com/s/article/2042141
0
sgleeAuthor Commented:
"you current host has not been patched for 12 months, and is old, and is behind by at least 7 updates, so how are you going to update your backup flash drive "  ---> As I was backing up USB stick, I was thinking the same. Whenever I make any changes to ESXi Host such as adding new VM or change RAM or increase HD size ... etc, now I have to go thru USB stick duplicate process ... that is not good.

So I see the benefit  of using vSphere Configuration Backup along with Configuration Manager.

"You restore using the details in this URL" --> So backing up configuration is done thru the menu. However restoring is manual process using CLI command? Is there such a thing as "vSphere Configuration Restore"?
0
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
"you current host has not been patched for 12 months, and is old, and is behind by at least 7 updates, so how are you going to update your backup flash drive "  ---> As I was backing up USB stick, I was thinking the same. Whenever I make any changes to ESXi Host such as adding new VM or change RAM or increase HD size ... etc, now I have to go thru USB stick duplicate process ... that is not good.

Correct, you are now thinking, and understanding, that duplication is not as good an idea as it seems!!!

So I see the benefit  of using vSphere Configuration Backup along with Configuration Manager.

Hallelujah Amen Brother

"You restore using the details in this URL" --> So backing up configuration is done thru the menu. However restoring is manual process using CLI command? Is there such a thing as "vSphere Configuration Restore"?

I'm afraid not, manual restore using command line.
0
sgleeAuthor Commented:
"Hallelujah Amen Brother" ---> LOL! Thanks Brother.
Let me try CLI command this weekend and get back to you.

I just wanted to make sure that I understand when I would perform this restore operation:
Say my original USB stick is corrupted and I don't have a backup usb stick. So I would install the right version of ESXi using CD and install the OS on a new USB stick. Then I run this CLI command to restore tar.gz file?
0
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
I just wanted to make sure that I understand when I would perform this restore operation:
Say my original USB stick is corrupted and I don't have a backup usb stick. So I would install the right version of ESXi using CD and install the OS on a new USB stick. Then I run this CLI command to restore tar.gz file?

Bingo Bongo - yes!
0
sgleeAuthor Commented:
Another question.
Whenever I like to duplicate a USB stick, should I turn off ESXi Host completely and pull it out or can I just pull it out while ESXi Host is turned on? The reason for asking is that I have noticed "heavy light blinking" on my USB stick right before it turned itself off. I am wondering if the changes are supposed to be written to USB stick before shutdown or restart...
0
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
Whenever I like to duplicate a USB stick, should I turn off ESXi Host completely and pull it out or can I just pull it out while ESXi Host is turned on?

The host must be turned off, ESXi is not designed to have the USB stick removed.

The reason for asking is that I have noticed "heavy light blinking" on my USB stick right before it turned itself off. I am wondering if the changes are supposed to be written to USB stick before shutdown or restart...

there is a schedule which periodically writes to the USB flash drive.

because USB flash drives are not supposed to be written to many times! So ESXi does not do it.
0
sgleeAuthor Commented:
I tried to duplicate 4gb USB stick, but the extra 4gb USB stick is bad. So I ended up buying 16gb USB stick. How do I go about duplicating a 4gb  USB  to a 16 GB USB stick?
0
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
How do I go about duplicating a 4gb  USB  to a 16 GB USB stick?

that is also an issue... it does not work! I did try to tell you cloning USB sticks, is useless!
0
sgleeAuthor Commented:
@Andrew,
 
 I downloaded & installed "VMware-vSphere-CLI-5.1.0-780721.exe (vCLI on Windows) on my Windows 10 PC and opened command prompt and ran the following command to back up a configuration file:
vicfg-cfgbackup.pl --server=192.168.2.101 --username=root -s TEST_ESXi_backup.tgz
However I do not think it created "TEST_ESXi_backup.tgz". instead it opens up vicfg-cfgbackup.pl file in Notepad program.
What am I doing wrong?Cli Command
0
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
the pl files are not associated with the perl binary, because they've been associated with notepad!

or make sure perl binary is in the path, or use a reference to perl to start the perl script
0
sgleeAuthor Commented:
"the pl files are not associated with the perl binary, because they've been associated with notepad! or make sure perl binary is in the path, or use a reference to perl to start the perl scrip" --> This sounds all foreign to me. Is there a simpler way of doing this?
0
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
Simple Windows 10 file associations, you've associate .pl files to notepad.

https://stackoverflow.com/questions/20601270/activeperl-pl-files-no-longer-execute-but-open-in-notepad-instead
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
VMware

From novice to tech pro — start learning today.