HOWTO.txt

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

This module helps in Initial Configuration, Unconfiguration, Upgrade and Maintenance of JetStream DR Software on
Azure VMware Solution (AVS) and on-prem vSphere.
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 (AVS only. This role is used to get the privileges to be copied to a new JSDR role)
3. Presence of Microsoft.AVS.Management module, version 7.0.170 or later (Used to filter AVS specific networks, secure folders 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 (PowerCLI 12.1 or later is required for Repair-Cluster)
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
   For on-prem vSphere, run Set-JSDRConfiguration from the JSDR.Setup module instead. It fixes PowerCLI dependencies,
   creates these sessions and sets up the context (sso domain, Admin role) used by this module:
   - Set-JSDRConfiguration -VC_Address "vc.example.com" -VC_Credential <administrator/PSCredential Object>
8. The script assumes it is being executed from a temporary directory and it uses the same directory to download and unzip JetDR bundle.
   Powershell variable; it is checked by Invoke-PreflightJetDRInstall and "vc.$SddcDnsSuffix" is used as the vCenter
   fqdn if it can't be determined otherwise.
9. The JetStream DR software management server will be created inside a secure folder (js-appliance). CloudAdmin users can
   see the MSA VM, but cannot change its settings.
10.The default name of the management server used by cmdlet is "msa@5.0.0+jetdr" when name is not provided by the user.

Usage of the Module:
There are twenty two Cmdlets which call the other Cmdlets in sequence to get a task done.

Installation and Uninstallation
  1. Invoke-PreflightJetDRInstall
  2. Invoke-PreflightJetDRUninstall
  3. Install-JetDRWithStaticIP
  4. Install-JetDRWithDHCP
  5. Uninstall-JetDR

Cluster Management
  6. Enable-JetDRForCluster
  7. Disable-JetDRForCluster
  8. Update-JetDR
  9. Resolve-HostIssue
  10. Resolve-ClusterIssue
  11. Repair-Cluster

vCenter Plugin, ESXi Daemons and Connectivity
  12. Register-JetDRPlugin
  13. Unregister-JetDRPlugin
  14. Restart-JetDRDaemon
  15. Test-JetDRApplianceConnection

Management Server Appliance (MSA)
  16. Enable-JetDRSshd
  17. Disable-JetDRSshd
  18. Enable-JetStreamRESTUser
  19. Disable-JetStreamRESTUser
  20. Start-MSA
  21. Restart-MSA
  22. Resize-JetDRMSAResources

1. Invoke-PreflightJetDRInstall

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

    .DESCRIPTION

    Checks to display current state of the system and minimum requirement are met before deploying JetDR. It also checks for minimum of 3 hosts in a cluster, jetdr plugin if already present in vcenter and if a vm exists with same name as MSA

    .PARAMETER VMName
    Name of the MSA VM (Optional, default msa@5.0.0+jetdr)

    .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

    Checks to display current state of the system and minimum requirement are met before uninstalling JetDR. It also checks for minimum of 4 hosts in a cluster

    .PARAMETER MSAIp
    Ip of the MSA

    .PARAMETER MSACredential
    root credentials of MSA

    .PARAMETER ProtectedCluster
    Protected cluster

    .EXAMPLE

    Invoke-PreflightJetDRUninstall -MSAIp xxx.xxx.xxx.xxx -MSACredential <root/PSCredential Object> -ProtectedCluster Src-Cluster

#>

3. Install-JetDRWithStaticIP

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

    .DESCRIPTION

    Deploys JetDR Management Server Appliance(MSA) version 5.0.0 with Static network IP configuration and configures one cluster

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

    .PARAMETER HostName
    Hostname(fqdn) of the MSA to be deployed (Optional)

    .PARAMETER MSACredential
    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 MSAIp
    Ip of the MSA to be deployed

    .PARAMETER Netmask
    Netmask of the MSA to be deployed

    .PARAMETER VlanId
    VLAN Tag ID for MSA to be deployed (Optional, leave blank if NA)

    .PARAMETER Cluster
    Cluster where the MSA will be deployed

    .PARAMETER VMName
    Name of the MSA VM (Optional, default msa@5.0.0+jetdr)

    .PARAMETER Datastore
    Datastore where MSA will be deployed

    .PARAMETER ProtectedCluster
    Cluster to be protected

    .PARAMETER RegisterWithIp
    Register MSA with IP instead of hostname (Optional, default $true)

    .EXAMPLE

    Install-JetDRWithStaticIP -Network "VM Network" -HostName "jsdr-msa.example.com" -MSACredential <root/PSCredential Object> -Gateway xxx.xxx.xxx.xxx -Dns xxx.xxx.xxx.xxx -MSAIp xxx.xxx.xxx.xxx -Netmask xxx.xxx.xxx.xxx -VlanId 101 -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" -MSACredential <root/PSCredential Object> -Gateway xxx.xxx.xxx.xxx -Dns xxx.xxx.xxx.xxx -MSAIp xxx.xxx.xxx.xxx -Netmask xxx.xxx.xxx.xxx -Cluster MSA-Cluster -VMName jsdr-msa -Datastore shared-ds -ProtectedCluster Src-Cluster -RegisterWithIp $false

#>

4. Install-JetDRWithDHCP

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

    .DESCRIPTION

    Deploys JetDR Management Server Appliance(MSA) version 5.0.0 with Dynamic network IP configurations and configures one cluster

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

    .PARAMETER HostName
    Hostname(fqdn) of the MSA to be deployed (Optional)

    .PARAMETER MSACredential
    root user credential of the MSA to be deployed

    .PARAMETER VlanId
    VLAN Tag ID for MSA to be deployed (Optional, leave blank if NA)

    .PARAMETER Cluster
    Cluster where the MSA will be deployed

    .PARAMETER VMName
    Name of the MSA VM (Optional, default msa@5.0.0+jetdr)

    .PARAMETER Datastore
    Datastore where MSA will be deployed

    .PARAMETER ProtectedCluster
    Cluster to be protected

    .PARAMETER RegisterWithIp
    Register MSA with IP instead of hostname (Optional, default $true)

    .EXAMPLE

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

#>

5. Uninstall-JetDR

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

    .DESCRIPTION

    Unconfigures cluster, unregisters vCenter from the JetDR MSA

    .PARAMETER MSAIp
    MSA IP

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

    .PARAMETER ProtectedCluster
    Cluster to be unconfigured

    .PARAMETER VMName
    Name of the MSA VM (Optional)

    .EXAMPLE

    Uninstall-JetDR -MSAIp xxx.xxx.xxx.xxx -MSACredential <root/PSCredential Object> -ProtectedCluster Src-Cluster -VMName jsdr-msa

#>

6. Enable-JetDRForCluster

<#

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

    .DESCRIPTION

    Configures an additional cluster for protection. installs vib to all hosts in the cluster and creates storage policies.
    If the cluster configuration fails and the cluster is managed by a vSphere Lifecycle Manager (vLCM) image, the
    cluster is remediated before trying to resolve the cluster issue.

    .PARAMETER MSAIp
    Ip of the MSA

    .PARAMETER MSACredential
    root credentials of MSA

    .PARAMETER ProtectedCluster
    Cluster to be protected

    .EXAMPLE

    Enable-JetDRForCluster -MSAIp xxx.xxx.xxx.xxx -MSACredential <root/PSCredential Object> -ProtectedCluster Src-Cluster

#>

7. Disable-JetDRForCluster

<#

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

    .DESCRIPTION

    Unconfigures a cluster, uninstalls vibs from all hosts in the cluster and removes storage policies. It will not uninstall JetDR completely

    .PARAMETER MSAIp
    Ip of the MSA

    .PARAMETER MSACredential
    root credentials of MSA

    .PARAMETER ProtectedCluster
    Cluster to be unconfigured

    .EXAMPLE

    Disable-JetDRForCluster -MSAIp xxx.xxx.xxx.xxx -MSACredential <root/PSCredential Object> -ProtectedCluster Src-Cluster

#>

8. Update-JetDR

<#

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

    .DESCRIPTION

    Upgrades JetDR components (MSA, vCenter plugin, DRVAs, RecoveryVAs and configured clusters) to version 5.0.0

    .PARAMETER Resume
    Resume upgrade if it failed at some point after upgrading MSA (Optional)

    .PARAMETER MSAIp
    Ip of the MSA

    .PARAMETER MSACredential
    root credentials of MSA

    .PARAMETER Datacenter
    Datacenter which manages the clusters

    .PARAMETER Datastore
    Datastore where upgrade iso will be copied

    .PARAMETER MSAVMName
    MSA VM name where upgrade iso will be mounted (Optional)

    .EXAMPLE

    Update-JetDR -MSAIp xxx.xxx.xxx.xxx -MSACredential <root/PSCredential Object> -Datacenter Datacenter -Datastore shared-ds -MSAVMName jsdr-msa

    .EXAMPLE

    Update-JetDR -MSAIp xxx.xxx.xxx.xxx -MSACredential <root/PSCredential Object> -Datacenter Datacenter -Datastore shared-ds -MSAVMName jsdr-msa -Resume $true

#>

9. Resolve-HostIssue

<#

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

    .DESCRIPTION

    Resolves last failed vCenter task on the host.

    .PARAMETER MSAIp
    Ip of the MSA

    .PARAMETER MSACredential
    root credentials of MSA

    .PARAMETER ProtectedCluster
    Cluster where the host resides

    .PARAMETER ESXHost
    Host where resolve issue will be done

    .EXAMPLE

    Resolve-HostIssue -MSAIp xxx.xxx.xxx.xxx -MSACredential <root/PSCredential Object> -ProtectedCluster Src-Cluster -ESXHost esxi-host-name

#>

10. Resolve-ClusterIssue

<#

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

    .DESCRIPTION

    Resolves the errors occurred during an install/uninstall/upgrade operation of an IO Filter on a cluster.

    .PARAMETER MSAIp
    Ip of the MSA

    .PARAMETER MSACredential
    root credentials of MSA

    .PARAMETER ProtectedCluster
    Cluster where resolve issue will be done

    .EXAMPLE

    Resolve-ClusterIssue -MSAIp xxx.xxx.xxx.xxx -MSACredential <root/PSCredential Object> -ProtectedCluster Src-Cluster

#>

11. Repair-Cluster

<#

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

    .DESCRIPTION

    Remediates a JetStream DR configured cluster that is managed by a vSphere Lifecycle Manager (vLCM) image,
    bringing its hosts back in compliance with the cluster image. Runs only against clusters configured with
    JetStream DR. Use Resolve-ClusterIssue afterwards to resolve JetStream DR configuration errors on the cluster.
    Requires PowerCLI 12.1 or later and vSphere 7.0 or later.

    .PARAMETER MSAIp
    Ip of the MSA

    .PARAMETER MSACredential
    root credentials of MSA

    .PARAMETER ProtectedCluster
    JetStream DR configured cluster to be remediated

    .EXAMPLE

    Repair-Cluster -MSAIp xxx.xxx.xxx.xxx -MSACredential <root/PSCredential Object> -ProtectedCluster Src-Cluster

#>

12. Register-JetDRPlugin

<#

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

    .DESCRIPTION

    Registers JetDR plugin to vCenter

    .PARAMETER MSAIp
    Ip of the MSA

    .PARAMETER MSACredential
    root credentials of MSA

    .PARAMETER RegisterWithIp
    Register MSA with Ip instead of hostname (Optional, default $true)

    .EXAMPLE

    Register-JetDRPlugin -MSAIp xxx.xxx.xxx.xxx -MSACredential <root/PSCredential Object> -RegisterWithIp:$true

#>

13. Unregister-JetDRPlugin

<#

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

    .DESCRIPTION
    Unregisters JetDR plugin from vCenter

    .PARAMETER MSAIp
    Ip of the MSA (Optional, leave blank if MSA is not available)

    .PARAMETER MSACredential
    root credentials of MSA (Optional, leave blank if MSA is not available)

    .EXAMPLE

    Unregister-JetDRPlugin -MSAIp xxx.xxx.xxx.xxx -MSACredential <root/PSCredential Object>

    .EXAMPLE

    Unregister-JetDRPlugin

#>

14. Restart-JetDRDaemon

<#

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

    .DESCRIPTION
    Restarts JetDR daemon on an ESXi host

    .PARAMETER ESXHost
    ESXi host where daemon should be restarted

    .PARAMETER DaemonName
    Daemon to restart. One of jetdr or jetiofrest (Optional, default jetdr)

    .PARAMETER ProtectedCluster
    Obsolete. Cluster where daemon should be restarted for all hosts

    .EXAMPLE
    Restart-JetDRDaemon -ESXHost esxi-ip/esxi-fqdn -DaemonName jetdr

    .EXAMPLE
    Restart-JetDRDaemon -ESXHost esxi-ip/esxi-fqdn -DaemonName jetiofrest

#>

15. Test-JetDRApplianceConnection

<#

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

    .DESCRIPTION
    Checks connection from Run Cmd infra to JetStream MSA. Includes traceroute information to the MSA.

    .PARAMETER MSAIp
    MSA Ip

    .EXAMPLE
    Test-JetDRApplianceConnection -MSAIp xxx.xxx.xxx.xxx

#>

16. Enable-JetDRSshd

<#

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

    .DESCRIPTION
    Starts sshd on JetStream MSA

    .PARAMETER VMName
    MSA VM Name (Optional, default msa@5.0.0+jetdr). Wildcards are not accepted.

    .PARAMETER MSACredential
    root credentials of MSA

    .EXAMPLE
    Enable-JetDRSshd -VMName jsdr-msa -MSACredential <root/PSCredential Object>

#>

17. Disable-JetDRSshd

<#

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

    .DESCRIPTION
    Stops sshd on JetStream MSA

    .PARAMETER VMName
    MSA VM Name (Optional, default msa@5.0.0+jetdr). Wildcards are not accepted.

    .PARAMETER MSACredential
    root credentials of MSA

    .EXAMPLE
    Disable-JetDRSshd -VMName jsdr-msa -MSACredential <root/PSCredential Object>

#>

18. Enable-JetStreamRESTUser

<#

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

    .DESCRIPTION
    Create a 'Partner REST Read+Write' role and a user (jetstream) for communication between MSA and ESXi

    .PARAMETER MSAIp
    Ip of the MSA

    .PARAMETER MSACredential
    root credentials of MSA

    .PARAMETER IOFRestUserName
    Obsolete. Name of the iofrest user to be created, default=jetstream

    .EXAMPLE
    Enable-JetStreamRESTUser -MSAIp xxx.xxx.xxx.xxx -MSACredential <root/PSCredential Object>

#>

19. Disable-JetStreamRESTUser

<#

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

    .DESCRIPTION
    Deletes user jetstream & its global permission

    .PARAMETER MSAIp
    Ip address of the MSA (Optional)

    .PARAMETER MSACredential
    root credentials of MSA (Optional)

    .EXAMPLE
    Disable-JetStreamRESTUser -MSAIp xxx.xxx.xxx.xxx -MSACredential <root/PSCredential Object>

#>

20. Start-MSA

<#

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

    .DESCRIPTION
    Power On MSA VM

    .PARAMETER VMName
    Name of the MSA VM (Optional, default msa@5.0.0+jetdr). Wildcards are not accepted.

    .EXAMPLE
    Start-MSA -VMName jsdr-msa

#>

21. Restart-MSA

<#

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

    .DESCRIPTION
    Restart MSA VM

    .PARAMETER VMName
    Name of the MSA VM (Optional, default msa@5.0.0+jetdr)

    .PARAMETER MSAIp
    MSA IP

    .PARAMETER MSACredential
    MSA Credential (root/admin or PSCredential Object)

    .PARAMETER MSAServiceOnly
    Restart only MSA tomcat service instead of the entire VM (Optional, default $false)

    .EXAMPLE
    Restart-MSA -VMName jsdr-msa -MSAIp xxx.xxx.xxx.xxx -MSACredential <root/PSCredential Object>

    .EXAMPLE
    Restart-MSA -VMName jsdr-msa -MSAIp xxx.xxx.xxx.xxx -MSACredential <root/PSCredential Object> -MSAServiceOnly $true

#>

22. Resize-JetDRMSAResources

<#

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

    .DESCRIPTION
    This cmdlet changes CPU/Memory of JetStream MSA. The MSA is shut down (or powered off with -PowerOff $true),
    resized and powered on again. At least one of NumCPU or MemoryGB should be provided.

    .PARAMETER MSAVMName
    MSA VM Name. Wildcards are not accepted.

    .PARAMETER MSAIp
    IP address of MSA

    .PARAMETER MSACredential
    MSA credential of admin/root user

    .PARAMETER NumCPU
    CPUs value to set, 4 to 16 (Optional)

    .PARAMETER MemoryGB
    Memory value to set in GB, 8 to 32 (Optional)

    .PARAMETER PowerOff
    Force poweroff instead of shutdown (Optional)

    .EXAMPLE
    Resize-JetDRMSAResources -MSAVMName jsdr-msa -MSAIp xxx.xxx.xxx.xxx -MSACredential <root/PSCredential Object> -NumCPU 4 -MemoryGB 8

    .EXAMPLE
    Resize-JetDRMSAResources -MSAVMName jsdr-msa -MSAIp xxx.xxx.xxx.xxx -MSACredential <root/PSCredential Object> -NumCPU 8 -MemoryGB 16 -PowerOff $true

#>