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 Microsoft.AVS.Management module (Used to filter AVS specific networks and set AVSAttributes)
4. Presence of VMware.vSphere.SsoAdmin module (Used to create/remove tmp sso user created during the process)
5. Presence of VMware.VimAutomation.Core module
6. Presence of VMware.VimAutomation.Storage module
7. 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
8. The script assumes it is being executed from a temporary directory and it uses the same directory to download and unzip JetDR bundle.
9. 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-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 3 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, if the datastore has enough space for MSA deployment, if the network provided is not one of the AVS protected networks.

    .PARAMETER VMName
    Name of the MSA VM

    .PARAMETER Cluster
    Cluster where the MSA will be deployed

    .PARAMETER ProtectedCluster
    Cluster to be protected

    .PARAMETER Datastore
    Datastore where MSA will be deployed

    .PARAMETER Network
    Network mapping for the MSA to be deployed, e.g 'VM Network'

    .EXAMPLE

    Invoke-PreflightJetDRInstall -VMName jsdr-msa -Cluster MSA-Cluster -ProtectedCluster Src-Cluster -Datastore datastore-name -Network network-name

#>

2. 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 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

#>


3. Install-JetDRWithStaticIP

<#
    .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
    root user credential of the MSA to be deployed

    .PARAMETER Gateway
    Gateway of the MSA to be deployed

    .PARAMETER Dns
    DNS IP that MSA 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

    .EXAMPLE

    Install-JetDRWithStaticIP -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

    .EXAMPLE

    Install-JetDRWithStaticIP -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

#>

4. Install-JetDRWithDHCP

<#
    .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
    root user credential 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

    .EXAMPLE

    Install-JetDRWithDHCP -Network "VM Network" -HostName "jsdr-msa.example.com" -Credential <root/PSCredential Object> -Cluster MSA-Cluster -VMName jsdr-msa -Datastore shared-ds -ProtectedCluster Src-Cluster
#>

5. Uninstall-JetDR

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

    .DESCRIPTION

    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

#>

6. Enable-JetDRForCluster

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

.DESCRIPTION

This Cmdlet configures an additional cluster for protection.
It installs vibs to all hosts in the cluster and creates storage policies.

    .PARAMETER MSIp

    Ip of the MSA

    .PARAMETER Credential

    root credentials of MSA

    .PARAMETER ProtectedCluster

    Cluster to be protected

    .PARAMETER RegisterWithIp
    Register MSA with Ip instead of hostname

.EXAMPLE

Enable-JetDRForCluster -MSIp xxx.xxx.xxx.xxx -Credential <root/PSCredential Object> -ProtectedCluster Src-Cluster -RegisterWithIp:$true
#>

7. Disable-JetDRForCluster

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

.DESCRIPTION

This Cmdlet unconfigures a cluster but doesn't uninstall JetDR completely so other clusters can still be used.
It uninstalls vibs from all hosts in the cluster and removes storage policies.

    .PARAMETER MSIp

    Ip of the MSA

    .PARAMETER Credential

    root credentials of MSA

    .PARAMETER ProtectedCluster

    Cluster to be unconfigured

    .PARAMETER RegisterWithIp
    Register MSA with Ip instead of hostname

.EXAMPLE

Disable-JetDRForCluster -MSIp xxx.xxx.xxx.xxx -Credential <root/PSCredential Object> -ProtectedCluster Src-Cluster -RegisterWithIp:$true
#>