Standalone backup agent for Microsoft Windows servers and workstations (formerly Veeam Endpoint Backup FREE)
Anguel
Expert
Posts: 193
Liked: 18 times
Joined: Apr 16, 2015 9:01 am
Location: Germany / Bulgaria
Contact:

Recovery Media Creation via Command Line

Post by Anguel » 1 person likes this post

Hi!

First of all many thanks to the Veeam developers for implementing my idea and adding a command line option to create the recovery media. This is extremely helpful after Veeam Agent updates.

Now I tested according to this document but unfortunately the command is executed but it immediately returns and no media is created:
https://helpcenter.veeam.com/docs/agent ... tml?ver=30

I tested with /f: option and without it, same result. When entering incorrect parameters however, Veeam reports an error. I also tried disabling anti-virus but this did not help.
Has anyone actually got this to work? Any hints are welcome.

Many thanks in advance,

Anguel
Dima P.
Product Manager
Posts: 14396
Liked: 1568 times
Joined: Feb 04, 2013 2:07 pm
Full Name: Dmitry Popov
Location: Prague
Contact:

Re: Recovery Media Creation via Command Line

Post by Dima P. »

Hello Anguel,

Thank you for the kind words! The command is not interactive (so once executed - consider the Recovery Creation process being initiated, you can see that in the Resource Monitor), if you do not see the .iso file in the specified location most likely it's still being created.
Anguel
Expert
Posts: 193
Liked: 18 times
Joined: Apr 16, 2015 9:01 am
Location: Germany / Bulgaria
Contact:

Re: Recovery Media Creation via Command Line

Post by Anguel »

Thank you Dima, I also waited for a long time but finally nothing appeared. Can you tell me which process to exactly look for? I am afraid I don't see it in the list.
Dima P.
Product Manager
Posts: 14396
Liked: 1568 times
Joined: Feb 04, 2013 2:07 pm
Full Name: Dmitry Popov
Location: Prague
Contact:

Re: Recovery Media Creation via Command Line

Post by Dima P. »

Search for Veeam Recovery Media process in task manager. In resource monitor that should be Veeam.Endpoint.RecoveryMedia.exe.
Anguel
Expert
Posts: 193
Liked: 18 times
Joined: Apr 16, 2015 9:01 am
Location: Germany / Bulgaria
Contact:

Re: Recovery Media Creation via Command Line

Post by Anguel »

Nope, it does not work. I also tested on a second PC.
After execution, running Get-Process Veeam* in Powershell returns the Veeam.Endpoint.RecoveryMedia process, but after a few seconds it disappears and no ISO is created.

BTW: I also have turned off Kaspersky Endpoint completely during execution.
Dima P.
Product Manager
Posts: 14396
Liked: 1568 times
Joined: Feb 04, 2013 2:07 pm
Full Name: Dmitry Popov
Location: Prague
Contact:

Re: Recovery Media Creation via Command Line

Post by Dima P. »

Can you please check if the recovery media creation works normally when it's started via regular UI?
Anguel
Expert
Posts: 193
Liked: 18 times
Joined: Apr 16, 2015 9:01 am
Location: Germany / Bulgaria
Contact:

Re: Recovery Media Creation via Command Line

Post by Anguel »

Yes, it creates the ISO without problems through the GUI wizard.
Dima P.
Product Manager
Posts: 14396
Liked: 1568 times
Joined: Feb 04, 2013 2:07 pm
Full Name: Dmitry Popov
Location: Prague
Contact:

Re: Recovery Media Creation via Command Line

Post by Dima P. »

Anguel,

Please submit a support case and share the case ID with us. There should be a way to identify the root cause via debug logs. Thank you in advance!
Anguel
Expert
Posts: 193
Liked: 18 times
Joined: Apr 16, 2015 9:01 am
Location: Germany / Bulgaria
Contact:

Re: Recovery Media Creation via Command Line

Post by Anguel »

I had a look at the log:

Code: Select all

[26.02.2019 12:49:30] <10> Error    Invalid media state EMediaMissing (System.Exception)
[26.02.2019 12:49:30] <10> Error       at Veeam.Endpoint.RecoveryMedia.UI.CRecoveryDiskBurner.ValidateTarget()
[26.02.2019 12:49:30] <10> Error       at Veeam.Endpoint.RecoveryMedia.UI.CRecoveryMediaCreator.Validate(CWimBuilderOptions options)
[26.02.2019 12:49:30] <10> Error       at Veeam.Endpoint.RecoveryMedia.UI.CRecoveryMediaCreator.CreateImpl()
[26.02.2019 12:49:30] <10> Error       at Veeam.Endpoint.RecoveryMedia.UI.CRecoveryMediaCreator.CreateProc()
[26.02.2019 12:49:30] <10> Info     [TaskLog] 'Failed to create recovery media: Invalid media state EMediaMissing' append, OrdinalId 1, Status EFailed, Desc ''
[26.02.2019 12:49:40] <01> Info     Operation failed.
I will submit the case.
Anguel
Expert
Posts: 193
Liked: 18 times
Joined: Apr 16, 2015 9:01 am
Location: Germany / Bulgaria
Contact:

Re: Recovery Media Creation via Command Line

Post by Anguel »

ID# 03434966
Anguel
Expert
Posts: 193
Liked: 18 times
Joined: Apr 16, 2015 9:01 am
Location: Germany / Bulgaria
Contact:

Re: Recovery Media Creation via Command Line

Post by Anguel »

While discussing with support I think I solved the problem myself. I just copy and paste from my last reply to support:

---------------------
On the PCs where the problem occurs – it always works with the GUI but does not work with the CLI. So your developers should know what is done different in the CLI.
It can’t be missing WinRE files, because it would not work with the GUI too, right? So no need to install any ADK as you previously proposed.

Again, I have some PCs where CLI media creation works and on some it does not.

Now I compared the UI.RecoveryImageWizard.log from a working PC and from a problem PC:
Both have this error first:

Code: Select all

[28.02.2019 12:53:38] <01> Error    [CBootFileLocator] WinReGetConfig function failed. Return code 0
But I think this NOT the problem, because this log entry also appears on the WORKING PCs.

But then I noticed this error which only appears on the problem PCs:

Code: Select all

[28.02.2019 12:53:40] <01> Error    Failed to check current media state
[28.02.2019 12:53:40] <01> Error    There is no media in the device.
[28.02.2019 12:53:40] <01> Error     (System.Runtime.InteropServices.COMException)
[28.02.2019 12:53:40] <01> Error       at Veeam.DesktopBackup.Core.RecoveryDisc.Interop.IMAPI2.IDiscFormat2Data.get_TotalSectorsOnMedia()
[28.02.2019 12:53:40] <01> Error       at Veeam.Core.Common.CDiskBurner.TryCalcCapacity(String recorderPath, UInt64& capacity)
And while I am writing this I think I solved the problem! I noticed in the GUI version that it first asks me where to write the image to – first choice is the built-in DVD and second is the ISO file. Then I noticed that the working PCs don’t have any built-in DVD, so there is only the ISO file option. This fits well with the There is no media in the device error.
As soon as I disabled the DVD in Windows device manager, now command line media can be created without problems.
So your developers should fix this probably by just always pointing CLI media creation to the ISO and ignoring any installed DVD drives etc. Right now they are probably just picking the first device listed and this is the problem.
I am looking forward to the fix!
----------------------

Anguel
Dima P.
Product Manager
Posts: 14396
Liked: 1568 times
Joined: Feb 04, 2013 2:07 pm
Full Name: Dmitry Popov
Location: Prague
Contact:

Re: Recovery Media Creation via Command Line

Post by Dima P. » 1 person likes this post

Hello Anguel,

Thank you for the details (maybe you are right - I was testing this command let on my laptop without optical drive). I pass this information to our RnD team, thanks again and have a great weekend.
Anguel
Expert
Posts: 193
Liked: 18 times
Joined: Apr 16, 2015 9:01 am
Location: Germany / Bulgaria
Contact:

Re: Recovery Media Creation via Command Line

Post by Anguel »

Just a short update: A few days ago Veeam support called me to confirm my assumptions and say thanks :-)
Unfortunately, it is still unclear when the problem will be solved by the developers. So it looks like people with DVD drives will have to go through the wizard a few more times :-(
Dima P.
Product Manager
Posts: 14396
Liked: 1568 times
Joined: Feb 04, 2013 2:07 pm
Full Name: Dmitry Popov
Location: Prague
Contact:

Re: Recovery Media Creation via Command Line

Post by Dima P. » 1 person likes this post

Anguel,

It's going to be fixed in the upcoming patch. Thanks again for your post!
Anguel
Expert
Posts: 193
Liked: 18 times
Joined: Apr 16, 2015 9:01 am
Location: Germany / Bulgaria
Contact:

Re: Recovery Media Creation via Command Line

Post by Anguel »

Thank you, Dima! This is great news, I still have not updated our 20 PCs ;-)
Dima P.
Product Manager
Posts: 14396
Liked: 1568 times
Joined: Feb 04, 2013 2:07 pm
Full Name: Dmitry Popov
Location: Prague
Contact:

Re: Recovery Media Creation via Command Line

Post by Dima P. » 1 person likes this post

Anguel,

v3.0.1 is out and it contains the mentioned fix. It's time to upgrade your agents :wink:
Biajja
Enthusiast
Posts: 49
Liked: 6 times
Joined: Jul 21, 2015 3:52 pm
Full Name: Biajja Chiemara
Contact:

Re: Recovery Media Creation via Command Line

Post by Biajja »

I'm making a new version of my Veeam Monitor that I posted here about 3 years ago.
Biajja
Enthusiast
Posts: 49
Liked: 6 times
Joined: Jul 21, 2015 3:52 pm
Full Name: Biajja Chiemara
Contact:

Re: Recovery Media Creation via Command Line

Post by Biajja »

Dima P. wrote: Mar 27, 2019 8:12 pm Anguel,

v3.0.1 is out and it contains the mentioned fix. It's time to upgrade your agents :wink:
I notice that the /f: argument has issues related to mapped drives / UNC paths... even local paths can cause an error.

I tried to push the ISO creation in command line to a network location using UNC path... in the logs it shows as path does not exist, I tried mapping that location to a drive letter... same entry in the logs stating the path does not exist...

I tried changing the location to the c:\users\public folder... it got to the final stage and then had an error when it attempted to write the iso to the directory...

This was all done while elevated to Administrator privileges...
dubritski
Lurker
Posts: 1
Liked: never
Joined: May 02, 2019 4:46 pm
Contact:

Re: Recovery Media Creation via Command Line

Post by dubritski »

I found this post on Mar 2nd 2019 and the link i was really interested in is this one
https://helpcenter.veeam.com/docs/agent ... tml?ver=30

It seems to me that it leads to a 404 page, (unless my internet is being dumb)

does that page still exist somewhere? I am working on a deployment to multiple computers, and like others I need to be able to do them remotely.
Vitaliy S.
VP, Product Management
Posts: 27055
Liked: 2710 times
Joined: Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov
Contact:

Re: Recovery Media Creation via Command Line

Post by Vitaliy S. »

Cannot find it either, but I will double-check it for you. Meanwhile, can you please clarify how are you managing these Agents? Do you do this via Veeam B&R or you are managing everything as standalone?
Vitaliy S.
VP, Product Management
Posts: 27055
Liked: 2710 times
Joined: Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov
Contact:

Re: Recovery Media Creation via Command Line

Post by Vitaliy S. »

Quick update: the corresponding article has been pulled back for clarifications. We will post it back as soon as it has been verified with VAW 3.0. Thanks!
Biajja
Enthusiast
Posts: 49
Liked: 6 times
Joined: Jul 21, 2015 3:52 pm
Full Name: Biajja Chiemara
Contact:

Re: Recovery Media Creation via Command Line

Post by Biajja »

I built an interface to manage Veeam Agent Installations (clients), perform a Veeam upgrade, gather information about a backup job, start an Ultra VNC session, with any machine on the network that has a Veeam backup created.

I'm in the final testing phase of it right now.
ds2
Enthusiast
Posts: 82
Liked: 19 times
Joined: Jul 16, 2015 6:31 am
Full Name: Rene Keller
Contact:

Re: Recovery Media Creation via Command Line

Post by ds2 »

Any news on it. Still no way to create recovery media from commandline?
Dima P.
Product Manager
Posts: 14396
Liked: 1568 times
Joined: Feb 04, 2013 2:07 pm
Full Name: Dmitry Popov
Location: Prague
Contact:

Re: Recovery Media Creation via Command Line

Post by Dima P. »

Hello ds2,

The commadline has been added in v3 but was slightly reworked in latest Veeam Agent for Windows 3.0.2 due to the described issue.

Install the latest version and execute C:\Program Files\Veeam\Endpoint Backup\Veeam.EndPoint.Manager.exe/createrecoverymediaiso command, that should store iso file to the default location C:\Users\UserName\Documents\
ds2
Enthusiast
Posts: 82
Liked: 19 times
Joined: Jul 16, 2015 6:31 am
Full Name: Rene Keller
Contact:

Re: Recovery Media Creation via Command Line

Post by ds2 »

Hi Dima,

thanks for the reply. Is there a way to specify a folder.
Dima P.
Product Manager
Posts: 14396
Liked: 1568 times
Joined: Feb 04, 2013 2:07 pm
Full Name: Dmitry Popov
Location: Prague
Contact:

Re: Recovery Media Creation via Command Line

Post by Dima P. »

Yup, should be possible with /f: %path% switch.
Vitaliy S.
VP, Product Management
Posts: 27055
Liked: 2710 times
Joined: Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov
Contact:

Re: Recovery Media Creation via Command Line

Post by Vitaliy S. »

A quick update to everyone subscribed to this thread, the corresponding UG page has been brought back with all the details: Creating Veeam Recovery Media with Command Line Interface
gonzo99
Enthusiast
Posts: 25
Liked: 5 times
Joined: Nov 04, 2015 11:26 am
Contact:

Re: Recovery Media Creation via Command Line

Post by gonzo99 » 1 person likes this post

Hey Vitaly,
are you sure that the command line in the mentioned UG page is correct?
It reads:

Code: Select all

"C:\Program Files\Veeam\Endpoint Backup\Veeam.EndPoint.Manager.exe" /createrecoverymediaiso [/f:<location>]
But this does not work with the V3.0.2.1170 installed on my machines. I have to use

Code: Select all

<path_to_program>\Veeam.EndPoint.RecoveryMedia.exe /createiso [/f:<location>]
For those who are fiddling with the same task, to create an actual recovery ISO image remotely, I have solved it using psexec.
In an administrative CMD window I start a batch with this content:

Code: Select all

start c:\windows\system32\cmd /c c:\windows\system32\PsExec.exe \\>computer_name> -u <domain_admin> -p <password> -h -d \\>some_server>\<some_public_share>\createiso.bat
Copy this line to reach more computers. With the trailing command "start c:\windows\system32\cmd /c" psexec will open a new window for every computer you have named.

The content of the batch file createiso.bat called by psexec:

Code: Select all

c:\Progra~1\Veeam\Endpoi~1\Veeam.EndPoint.RecoveryMedia.exe /createiso /f:\\<some_server>\<some_public_share>\veeamiso\VeeamRecoveryMedia_V3.0.2_%computername%.iso
This was the trickiest part, a DOS batch needs to find the correct path to the exe file. I had to test a lot of versions, only the "old" naming with the 8 letter path (German Windows) worked. Luckily the path is the same on 32 and 64bit systems. And it works on Windows systems from V7 to V10-1903 and on 2008R2 and 2012R2/2016/2019 servers.
Dima P.
Product Manager
Posts: 14396
Liked: 1568 times
Joined: Feb 04, 2013 2:07 pm
Full Name: Dmitry Popov
Location: Prague
Contact:

Re: Recovery Media Creation via Command Line

Post by Dima P. »

Hello gonzo99,

Thanks for the detailed feedback! I'll ask Technical Writes to double check the information. Cheers!
Dima P.
Product Manager
Posts: 14396
Liked: 1568 times
Joined: Feb 04, 2013 2:07 pm
Full Name: Dmitry Popov
Location: Prague
Contact:

Re: Recovery Media Creation via Command Line

Post by Dima P. »

Quick update:

Try to use the

Code: Select all

"C:\Program Files\Veeam\Endpoint Backup\Veeam.EndPoint.Manager.exe" /createrecoverymediaiso [/f:pathtofile]
Where pathtofile includes the name of the file with the extension (so should be D:\MyIso.iso instead of D:\). We will update documentation with this information as well.
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 31 guests