HOWTO.txt

========================================================================================================================
                                              HOW TO USE THE MODULE
========================================================================================================================

This module helps in Initial Configuration and Unconfiguration of JetStream DR Software.
To use the module, first it needs to be installed. It can be installed by the following
command:

> Install-Module -Name JSDR.Configuration

The module has the following pre-requisites:
1. Powershell version > 7
2. Presence of CloudAdmin role in vCenter (This role is used to get the privilleges to be copied to a new JSDR role)
3. Presence of VMware.vSphere.SsoAdmin module (Used to create/remove tmp sso user created during the process)
4. Presence of VMware.VimAutomation.Core module
5. VIServer and SsoAdmin session as admin user should be created before running the script.
   - Connect-VIServer -Server xxx.xxx.xxx.xxx -user vsphere.local\administrator -Password ***
   - Connect-SsoAdminServer -Server xxx.xxx.xxx.xxx -user vsphere.local\administrator -Password *** -SkipCertificateCheck
6. The script assumes it is being executed from a temporary directory and it uses the same directory to download and unzip JetDR bundle.
7. Variable VC_ADDRESS is exposed as a Powershell variable.

Usage of the Module:
There are mainly five Cmdlets which calls the other Cmdlets in sequence to get a task done.

1. Invoke-PreflightJetDRSystemCheck

    <#
    .NOTES
    ===========================================================================
    Created by: JetStream Software Inc
    ===========================================================================

    .DESCRIPTION
    This Cmdlet checks and displays current state of the system
        It checks whether the minimal requirements for the script to run are met.

    .EXAMPLE Invoke-PreflightJetDRSystemCheck

#>

2. Invoke-PreflightJetDRInstall

    <#
    .NOTES
    ===========================================================================
    Created by: JetStream Software Inc
    ===========================================================================

    .DESCRIPTION
    This Cmdlet checks and displays current state of the system
        It checks whether the minimal requirements for the script to run are met.
        It also checks if the cluster has minimum of 4 hosts, if the cluster details are correct, if there is already a VM with the same name provided for installing MSA, if there is any jetdr plugin present in the vCenter.

    .PARAMETER VMName
    Name of the MSA VM

    .PARAMETER Cluster
    Cluster where the MSA will be deployed

    .PARAMETER ProtectedCluster
    Cluster to be protected

    .EXAMPLE Invoke-PreflightJetDRInstall -VMName jsdr-msa -Cluster MSA-Cluster -ProtectedCluster Src-Cluster

#>

3. Invoke-PreflightJetDRUninstall

    <#
    .NOTES
    ===========================================================================
    Created by: JetStream Software Inc
    ===========================================================================

    .DESCRIPTION
    This Cmdlet checks and displays current state of the system
        It checks whether the minimal requirements for the script to run are met.
        It also checks if the cluster has minimum of 4 hosts, if the cluster details are correct and if any VCenter is registered to the MSA

    .PARAMETER MSIp
    Ip of the MSA

    .PARAMETER Credential
    root credentials of MSA

    .PARAMETER ProtectedCluster
    Cluster to be protected

    .EXAMPLE Invoke-PreflightJetDRUninstall -MSIp xxx.xxx.xxx.xxx -Credential <root/PSCredential Object> -ProtectedCluster Src-Cluster

#>
 
4. Install-JetDR

    <#
    .NOTES
    ===========================================================================
    Created by: JetStream Software Inc
    ===========================================================================

    .DESCRIPTION
    This top level Cmdlet Downloads JetDr bundle from MMS, creates a new user, assigns
    elevated privilleges to the user, deploys JetDr Management Server Appliance(MSA),
    registers vCenter to the JetDr MSA, configures cluster.

    .PARAMETER Network
    Network mapping for the MSA to be deployed, e.g 'VM Network'"
    
    .PARAMETER HostName
    Hostname of the MSA to be deployed

    .PARAMETER Credential
    Credential of root user of MSA to be deployed(root or PSCredential Object)

    .PARAMETER Gateway
    Gateway of the MSA to be deployed
    
    .PARAMETER Dns
    DNS IP that MS should use

    .PARAMETER MSIp
    Ip of the MSA to be deployed

    .PARAMETER Netmask
    Netmask of the MSA to be deployed

    .PARAMETER Cluster
    Cluster where the MSA will be deployed

    .PARAMETER VMName
    Name of the MSA VM

    .PARAMETER Datastore
    Datastore where MSA will be deployed

    .PARAMETER ProtectedCluster
    Cluster to be protected

    .PARAMETER RegisterWithIp
    Register MSA with IP instead of hostname
    
    .PARAMETER Mode
    Mode in which JetDR will be registered C2C/TEST_FAILOVER

    .EXAMPLE Install-JetDR -Network "VM Network" -HostName "jsdr-msa.example.com" -Credential <root/PSCredential Object> -Gateway xxx.xxx.xxx.xxx -Dns xxx.xxx.xxx.xxx -MSIp xxx.xxx.xxx.xxx -Netmask xxx.xxx.xxx.xxx -Cluster MSA-Cluster -VMName jsdr-msa -Datastore shared-ds -ProtectedCluster Src-Cluster -RegisterWithIp $true -Mode "C2C"
#>

5. Uninstall-JetDR

    <#
    .NOTES
    ===========================================================================
    Created by: JetStream Software Inc
    ===========================================================================

    The top level Cmdlet creates a new user, assigns elevated privilleges to the user,
    unconfigures cluster, unregisters vCenter from the JetDr MSA, removes the user.

    .PARAMETER MSIp
    MSA IP

    .PARAMETER Credential
    Credential of root user of MSA(root or PSCredential Object)

    .PARAMETER ProtectedCluster
    Cluster to be unconfigured

    .EXAMPLE Uninstall-JetDR -MSIp xxx.xxx.xxx.xxx -Credential <root/PSCredential Object> -ProtectedCluster Src-Cluster

#>