Before you start: 

  1. For using Docker powershell we need to load Posh-SSH  and CaaS(PowerShell module for CaaS) powershell module as well.
  2. Download the Docker powershell module DockerCaaS.psd1 from the Source code (zip) from one of the CaaS release  it contains the module "<zip>\<version>\Docker\DockerCaaS.psd1"
    eg : DimensionData.ComputeClient-3.0.3.zip\DimensionData.ComputeClient-3.0.3\Docker\DockerCaaS.psd1

  3. Make sure the SSH port TCP:22 should be open on the network , 
    eg :New-CaasAclRule -AclRuleName "AllowSSHPort22" -Network "TEST-WEB" -Position 120 -Action PERMIT -Protocol TCP -PortRangeType EQUAL_TO -Port1 22 -AclType OUTSIDE_ACL 
  4. You have connected to VPN, so that you can SSH into it

 

Usage Steps:

  1. Load the Docker Powershell Module 

    import-module "<Path>\DockerCaaS.psd1"

  2. Connect to CaaS Cloud API 

    New-CaasConnection -ApiCredentials (Get-Credential) -Vendor DimensionData -Region Australia_AU

  3. Create one or more docker hosts, if not created already

    New-CaasDockerHost -Name <DockerHostName> -NetworkName <MCP1NetworkName> -RootPassword <AdminPassword>

    Note: Make sure to use the same RootPassword for all docker hosts.

  4. Deploy docker containers

    Invoke-CaasDockerContainer -Name <NameOfDockerContainer> -Parameters <AnyDockerParameters> -NetworkName <MCP1NetworkName> -RootPassword <AdminPasswordOfDockerHost>

    eg : Invoke-CaasDockerContainer -Name "tomcat:8.0" -Parameters "-p 8080:8080 -d" -NetworkName "TEST-WEB" -RootPassword "unicorndatapass"

 

Note:

These command dont open any ports (ACL) related to the docker containers , so if you need to open any ports for any docker containers, you need to do that manually

 

TroubleShooting

1> No SSH ACL is open

"New-SSHSession : No connection could be made because the target machine actively refused it 10.208.181.11:22"

2> Docker host might be down (make sure the docker hosts are running, and do delete the hosts on which New-CaasDockerHost had failed previously)

New-SSHSession : Connection failed to establish within 10000 milliseconds.

  • No labels