cancel
Showing results for 
Search instead for 
Did you mean: 

bemcli

tisso
Level 3

HI,

 

I have PS, and can run the BEMCLI.

I can create a VM (VMware) using a backup set from BE Wizard. So, I am trying to match the parameters to do the same using a BEMCLI.

The help syntax for "Submit-BEConvertBackupToVirtualJob" is confusing.

Submit-BEConvertBackupToVirtualJob -JobHistory [<BEJobHistory>] -TargetEnvironment [<BEConvertToVirtualTargetEnvironment>] [-AutomaticallyDeleteJob {Never | IfSuccessful | WhenComplete}] [-Priority {Normal | Lowest | Low | High | Highest}] [-StartDate [<DateTime>]] [-SubmitOnHold [<Boolean>]] [-ExcludeNonSystemData [<SwitchParameter>]] [-VirtualMachineName [<String>]] [-Name [<String>]] [-VirtualMachineCpuCount [<UInt32>]] [-VirtualMachinePhysicalRamMB [<UInt32>]] [-OverwriteExistingVirtualMachine [<Boolean>]] [-Confirm
[<SwitchParameter>]] [-WhatIf [<SwitchParameter>]] [<CommonParameters>]

 

When I go step-by-step, not sure how to progress.

BEMCLI > Submit-BEConvertBackupToVirtualJob

What value for TargetEnvironment to set?

I'd like to see if anyone can share some good examples with explanations on how to get the values for the parameters before running the script.

 

Thanks a lot

 

 

10 REPLIES 10

pkh
Moderator
Moderator
   VIP    Certified

Take a look at the BEMCLI documentation and under each cmdlet you can see samples of how the cmdlet is used.  For example, for the BEConvertBackupToVirtualJob cmdlet

 

C:\PS> $targetEnvironment = New-BEConvertToVirtualTargetEnvironment -HyperVServerName hypervserver01 -HyperVDestinationPath c:\vms -LogonAccount "System Logon Account" -ToolsIsoPath c:\hypervtools.iso
C:\PS> Get-BEJob "Job 0001" | Get-BEJobHistory -FromLastJobRun | Submit-BEConvertBackupToVirtualJob -FileSystemSelection C:\BackedUpData\*.*

These commands create a virtual machine on a Hyper-V server using data from the most recent run of a job named "Job 0001".

If you need other samples of how BEMCLI, see my other articles/downloads

https://www-secure.symantec.com/connect/articles/using-bemcli-speed-tasks

https://www-secure.symantec.com/connect/articles/use-bemcli-chain-jobs

https://www-secure.symantec.com/connect/articles/preparing-your-powershell-environment-run-bemcli-and-scripts

https://www-secure.symantec.com/connect/downloads/script-chaining-jobs-be-2012

https://www-secure.symantec.com/connect/downloads/bemcli-script-import-tape-first-empty-slot

tisso
Level 3

Dear pkh,

Thanks for the links.

Is BEMCLI an official supported tool (i.e. if we configure a scritp to run it, and there is an issue, can we call Support?".

Or, is it just an admin tool?

Thanks.

 

pkh
Moderator
Moderator
   VIP    Certified

BEMCLI is a part of BE 2012 so it is supported.  However, you got to be careful when your script fails.  If your script has 10 PS cmdlets and 1 BEMCLI cmdlet, you got to make sure that it is the failure of the BEMCLI cmdlet before you can call Support.  If the other PS cmdlets fails or are not used properly, or the BEMCLI cmdlet fails because parameters are not passed correctly to if from the other cmdlets, then obviously Symantec is not responsible.

tisso
Level 3

Hi,

If anyone can tell me how and what value to set for "TargetEnvironment", I would appreciate.Thanks.

pkh
Moderator
Moderator
   VIP    Certified

If you are refering to the example above, it is the various parameters to define the VM host that you are converting the backup to.  You got to put in the actual parameters for your environment, e.g. the name of the VM host.

tisso
Level 3

ESX host is "AB-esx1.xyz.com"

In hosts file: edited the IP both as "AB-esx1" and "AB-esx1.xyz.com". Both names ping-able.

The errors:

Cannot bind parameter 'TargetEnvironment'. Cannot convert the "AB-esx1" value of type "System.String" to type "BackupExec.Management.CLI.BEConvertToVirtualTargetEnvironment"

Thanks

 

pkh
Moderator
Moderator
   VIP    Certified

Copy and paste the actual command that you use and the response.

Have you done a convert to virtual using his VM host with the GUI? If not, you should do so before you try using BEMCLI.  You should also use the name of the VM host as it is known to BE.

tisso
Level 3

Errors: (same error with host or IP name)

BEMCLI> Submit-BEConvertBackupToVirtualJob
cmdlet Submit-BEConvertBackupToVirtualJob at command pipeline position 1
Supply values for the following parameters:
AgentServer: nbu-client2
TargetEnvironment: 71.27.88.17
Submit-BEConvertBackupToVirtualJob : Cannot bind parameter 'TargetEnvironment'.
 Cannot convert the "71.27.88.17" value of type "System.String" to type "Backup
Exec.Management.CLI.BEConvertToVirtualTargetEnvironment".
At line:1 char:35
+ Submit-BEConvertBackupToVirtualJob <<<<
    + CategoryInfo          : InvalidArgument: (:) [Submit-BEConvertBackupToVi
   rtualJob], ParameterBindingException
    + FullyQualifiedErrorId : CannotConvertArgumentNoMessage,BackupExec.Manage
   ment.CLI.Commands.SubmitBEConvertBackupToVirtualJobCommand

 

Yes, I have successfully converted using GUI BE and these are the values I used:

Physical server name = nbu-client2

ESX Server = 71.27.88.17 (test-esxi2)

VM name = VM_nbu-client2

 

Thanks

 

pkh
Moderator
Moderator
   VIP    Certified

You cannot just enter Submit-BEConvertBackupToVirtualJob.  It will not work.  Take a look at the example referenced above and see what needs to be fed into this cmdlet to get it to work.

Russell_Norton
Level 3
Employee

The example used in the BEMCLI documenation is not 100% accrate. There is no FIlesystemSelection for  Submit-BEConvertBackupToVirtualJob and it dose not tell you where to use the $targetEnvironment.

Here is an example  for vmware

BEMCLI> $targetEnvironment = New-BEConvertToVirtualTargetEnvironment -VMwareVCenterServerName <vcentername> -VMwareHostName <hostname> -VMwareDataStoreName <datastore> -LogonAccount <login account> -ToolsIsoPath <path to vmware tools iso>
 

To run the convertion

BEMCLI>Get-BEAgentServer <server you want to convert> | Get-BEJobHistory -FromLastJobRun  Submit-BEConvertBackupToVirtualJob  -TargetEnvironment $targetEnvironment

NOTE:Commands are all on one line

There are many options for the target enviroment and convertion job cmdlets.

I would suggest refering to the full help documentaion for each cmdlet

get-help  New-BEConvertToVirtualTargetEnvironment -full

get-help  Submit-BEConvertBackupToVirtualJob  -full