Search
The Best Hyperconverged
Appliance
for Enterprise ROBO,
SMB & Edge

StarWind Virtual SAN: Feature Configuration Guide for Gentle Shutdown with APC PowerChute

Annotation

Relevant Products

StarWind Virtual SAN (VSAN)

Purpose

The purpose of this integration is to provide a reliable solution for managing unexpected power outages and planned hardware maintenance. By using PowerChute, users can ensure a gentle shutdown of VMs and hosts, effectively placing StarWind devices into maintenance mode to safeguard data and minimize synchronization times post-power outage.

Audience

The guide is aimed at system administrators, IT professionals, and data center managers who use StarWind Virtual SAN® and protect their servers with APC Smart-UPS.

Expected Result

After successful integration, PowerChute should enable the efficient and safe shutdown of VMs and hosts in case of power outages, with StarWind devices smoothly transitioning into maintenance mode. This setup aims to prevent potential issues with setup and reduce the time needed for StarWind devices synchronization after power is restored.

 

Introduction to PowerChute

PowerChute is a cross-platform application for managing APC Smart-UPS allowing users to manage UPS and prevent the unexpected power outage or plan the hardware maintenance when needed.
The combination of the PowerChute Network software and StarWind Maintenance Script allows users to gently turn off VMs and hosts, put the StarWind devices into maintenance mode and prevent the impact of an unexpected blackout. Users can save their data and avoid long synchronization.
NOTE: It’s recommended to install PowerChute on a dedicated machine (or server) that has its own UPS.

Disclaimer: StarWind Support does not write scripts on demand. Custom script troubleshooting is not supported. For PowerChute configuration please reach out to APC support.

Selecting the Environment

Please select the required option:

Installing PowerChute for Hyper-V

Installing PowerChute Network
1. Launch the downloaded setup file on the server to install PowerChute Network. The Setup wizard will appear. Read and accept the License Agreement.

2. PowerChute Network requires a Java Runtime Environment (JRE). Choose the Use the private JRE bundled with PowerChute option.

3. Select the Enable SNMP Support checkbox to manage the PowerChute from a different console.
4. Select Do not enable VMware Support. 
5. Select Browse to modify the installation path if necessary. Otherwise, save the path offered by default.
6. Click Install to continue.
7. Click Finish to close the wizard.
Configuring PowerChute Network
1. On the Welcome page, read the information and click Next.
2. In Network Configuration, select the appropriate network configuration.
3. Specify the required connection scenario.

4. On the Security step, specify the Network Management Card credentials of APC Smart UPS.
9. Verify the information and click Apply to finish the configuration.
Applying StarWind Maintenance Script
StarWind has designed the script which allows users to gently turn off VMs and hosts, put the StarWind devices into Maintenance mode to prevent the data loss and long synchronization process.
1. Navigate to Configure Events and click on UPS on Battery command file.
2. Enable the command file checkbox for the UPC on Battery event (local or network path can be selected).
3. Select the following script file:

# Execute lines below before running this script, to generate SecureString passwords
 
#################################################################################
 
#mkdir c:\shutdown
 
#Read-Host -Prompt "Enter password for service user" -AsSecureString | ConvertFrom-SecureString | out-file c:\shutdown\cred.txt
 
#(type in the password of the user you want to use for running the script)
 
#cat c:\shutdown\cred.txt
 
 
 
$password = get-content C:\shutdown\cred.txt | convertto-securestring
 
$user = "Domain\ServiceUser"  #Specify domain/user credentials 
 
$cred = New-Object System.Management.Automation.PSCredential ($user,$password)
 
 
 
$StarWind = 'SW-HCA-VM-01' #specify your StarWind VM (or host) ip-address
 
 
 
#Getting StarWind devices in to "Maintenance Mode"
 
Import-Module StarWindX
 
 
 
try
 
{
 
    $server = New-SWServer -host $StarWind -port 3261 -user root -password starwind
 
    $server.Connect()
 
    write-host "Devices:" -foreground yellow
 
   
 
    foreach($device in $server.Devices){
 
        if( !$device ){
 
            Write-Host "No device found" -foreground red
 
            return
 
        } else {
 
            $device.Name
 
            $disk = $device.Name
 
            if ($device.Name -like "HAimage*"){
 
                $device.SwitchMaintenanceMode($true, $true)
 
                write-host "$disk entered maintenance mode"
 
            } else {
 
                write-host "$disk is not an HA device, maintenance mode is not supported"
 
            }
 
        }
 
    }
 
}
 
catch
 
{
 
       Write-Host $_ -foreground red
 
}
 
finally
 
{
 
       $server.Disconnect()
 
}
 
 
 
#Here I'll start a new PowerShell remote session with the selected host
 
 
 
Enter-PSSession -ComputerName $StarWind -Credential $cred
 
$action = New-ScheduledTaskAction -Execute 'Powershell.exe' -Argument '-ExecutionPolicy Bypass c:\SW_Maintenance_Off.ps1 -RunType $true -Path c:\SW_Maintenance_Off.ps1'
 
 
 
$trigger = New-ScheduledTaskTrigger -AtStartup -RandomDelay 00:00:30
 
 
 
$settings = New-ScheduledTaskSettingsSet -Compatibility Win8
 
 
 
$principal = New-ScheduledTaskPrincipal -UserId SYSTEM -LogonType ServiceAccount -RunLevel Highest
 
 
 
$definition = New-ScheduledTask -Action $action -Principal $principal -Trigger $trigger -Settings $settings -Description "Maintenance Mode"
 
 
 
Register-ScheduledTask -TaskName "Maintenance Mode off" -InputObject $definition

NOTE: VMs or Nodes might be needed to install some Windows updates, so it is highly recommended to set them up in the PowerChute console before running this script itself.
Allow PowerShell remote session on both hosts to use this script. Setup power-off configuration in PowerChute console for all the VMs, then run the following script from PowerChute console (apply the Maintenance mode on StarWind devices).

Installing PowerChute for VMware

Installing PowerChute Network
1. Launch the downloaded setup file on the server to install PowerChute Network. The Setup wizard will appear. Read and accept the License Agreement.

2. PowerChute Network requires a Java Runtime Environment (JRE). Choose the Use the private JRE bundled with PowerChute option.

3. Select the Enable SNMP Support checkbox to manage the PowerChute from a different console.
4. If VMware is used in the environment, select Enable VMware Support.

5. Select Browse to modify the installation path if necessary. Otherwise, save the path offered by default.

6. Click Install to continue.
7. Click Finish to close the wizard.
Configuring PowerChute Network
1. On the Welcome page, read the information and click Next.
2. In Network Configuration, select the appropriate network configuration: IPv4 or IPv6.
3. Specify the required connection scenario.

4. In VMware Configuration, specify the connection method to the environment: Standalone VMware Host for single host or Host managed by vCenter Server for vCenter.
5. Specify the IP address and credentials of the vCenter.

NOTE: Select the vCenter Server running on a VM option if vCenter is running on the VM inside the ESXi host.
6. Select the hosts powered by the UPS(s).

7. Specify the Virtualization Settings.

8.  On the Security step, Specify the Network Management Card credentials of APC Smart UPS.
9. Verify the information and click Apply to finish the configuration.
Applying StarWind Maintenance Script
StarWind has designed the script which allows users to gently turn off VMs and hosts, put the StarWind devices into Maintenance mode to prevent the data loss and long synchronization process.
1. Navigate to Configure Events and click on UPS on Battery command file.

2. Enable the command file checkbox for the UPC on Battery event (local or network path can be selected).
Select the following script file:

################################################################################
 
#
 
# Variables:  $vcenter - The IP/DNS of your vCenter Server
 
#             $username/password - credentials for your vCenter Server
 
#             $username4host/password4host - credentials for yours VM host
 
#             $cluster - Name of specific cluster to target within vCenter
 
#             $datacenter - Name of specific datacenter to target within vCenter
 
#             $StarWind - IP address of one of StarWind VMs
 
#
 
#################################################################################
 
# Execute lines below before running this script, to generate securestring passwords
 
#################################################################################
 
#mkdir c:\shutdown
 
#Read-Host -Prompt "Enter password for vCenter" -AsSecureString | ConvertFrom-SecureString | out-file c:\shutdown\cred.txt
 
#(type in the password of the user you want to use for running the script)
 
#cat c:\shutdown\cred.txt
 
#
 
#Read-Host -Prompt "Enter password for ESXI hosts" -AsSecureString | ConvertFrom-SecureString | out-file c:\shutdown\cred4host.txt
 
#(type in the password of the user you want to use for running the script)
 
#cat c:\shutdown\cred4host.txt
 
################################################################################
 

 
# Some variables
 
$vcenter = "192.168.1.235"
 
$username = "administrator@vsphere.local"
 
$username4host = "root"
 
$cluster = "SW-SUP-CLUSTER"
 
$datacenter = "SWDATACENTER"
 
$vCenterVMName = "SW-SUP-VCENTER" #Name of vCenter VM
 
$StarWindVM1 = "SW-SUP-FS-00" #Name of first StarWind VM
 
$StarWindVM2 = "SW-SUP-FS-01" #Name of second StarWind VM

$StarWind = "192.168.1.233" #IP address of one of StarWind VMs
 
$ESXIhost1 = "192.168.1.231" #Name of first ESXI Host
 
$ESXIhost2 = "192.168.1.232" #Name of second ESXI Host
 
 
 
$password = get-content C:\shutdown\cred.txt | convertto-securestring
 
$password4host = get-content C:\shutdown\cred4host.txt | convertto-securestring
 
$credentials = new-object System.Management.Automation.PSCredential $username, $password
 
$credentials4host = new-object System.Management.Automation.PSCredential $username4host, $password4host
 
$time = ( get-date ).ToString('HH-mm-ss')
 
$date = ( get-date ).ToString('dd-MM-yyyy')
 
$logfile = New-Item -type file "C:\shutdown\ShutdownLog-$date-$time.txt" -Force
 
 
 
Write-Host ""
 
Write-Host "Shutdown command has been sent to the vCenter Server." -Foregroundcolor yellow
 
Write-Host "This script will shutdown all of the VMs and hosts located in $datacenter." -Foregroundcolor yellow
 
Write-Host ""
 
Sleep 5
 
 
 
Add-Content $logfile "$(get-date -f dd/MM/yyyy) $(get-date -f HH:mm:ss) PowerOff Script Engaged"
 
Add-Content $logfile ""
 
 
 
# Connect to vCenter
 
$counter = 0
 
if ($counter -eq 0){
 
       Set-PowerCLIConfiguration -InvalidCertificateAction ignore -Confirm:$false | Out-Null
 
}
 
Write-Host "Connecting to vCenter - $vcenter.... " -nonewline
 
Set-PowerCLIConfiguration -InvalidCertificateAction ignore -confirm:$false
 
Add-Content $logfile "$(get-date -f dd/MM/yyyy) $(get-date -f HH:mm:ss) Connecting to vCenter - $vcenter"
 
$success = Connect-VIServer $vcenter -Credential $credentials -WarningAction:SilentlyContinue
 
if ($success) { Write-Host "Connected!" -Foregroundcolor Green }
 
else
 
{
 
    Write-Host "Something is wrong, Aborting script" -Foregroundcolor Red
 
    Add-Content $logfile "$(get-date -f dd/MM/yyyy) $(get-date -f HH:mm:ss) Something is wrong, Aborting script"
 
    exit
 
}
 
Write-Host ""
 
Add-Content $logfile  ""
 
 
 
# Turn Off vApps
 
Write-Host "Stopping VApps...." -Foregroundcolor Green
 
Write-Host ""
 
Add-Content $logfile "$(get-date -f dd/MM/yyyy) $(get-date -f HH:mm:ss) Stopping VApps..."
 
Add-Content $logfile ""
 
 
 
$vapps = Get-VApp | Where { $_.Status -eq "Started" }
 
 
 
if ($vapps -ne $null)
 
{
 
    ForEach ($vapp in $vapps)
 
    {
 
            Write-Host "Processing $vapp.... " -ForegroundColor Green
 
            Write-Host ""
 
            Add-Content $logfile "$(get-date -f dd/MM/yyyy) $(get-date -f HH:mm:ss) Stopping $vapp."
 
            Add-Content $logfile ""
 
            Stop-VApp -VApp $vapp -Confirm:$false | out-null
 
            Write-Host "$vapp stopped." -Foregroundcolor Green
 
            Write-Host ""
 
    }
 
}
 
 
 
Write-Host "VApps stopped." -Foregroundcolor Green
 
Add-Content $logfile "$(get-date -f dd/MM/yyyy) $(get-date -f HH:mm:ss) VApps stopped."
 
Add-Content $logfile ""
 
 
 
# Change DRS Automation level to partially automated...
 
Write-Host "Changing cluster DRS Automation Level to Partially Automated" -Foregroundcolor green
 
Get-Cluster $cluster | Set-Cluster -DrsAutomation PartiallyAutomated -confirm:$false
 
 
 
# Change the HA Level
 
Write-Host ""
 
Write-Host "Disabling HA on the cluster..." -Foregroundcolor green
 
Write-Host ""
 
Add-Content $logfile "Disabling HA on the cluster..."
 
Add-Content $logfile ""
 
Get-Cluster $cluster | Set-Cluster -HAEnabled:$false -confirm:$false
 
 
 
 
 
 
 
 
 
# Get VMs again (we will do this again instead of parsing the file in case a VM was powered in the nanosecond that it took to get here....
 
Write-Host ""
 
Write-Host "Retrieving a list of powered on guests...." -Foregroundcolor Green
 
Write-Host ""
 
Add-Content $logfile "$(get-date -f dd/MM/yyyy) $(get-date -f HH:mm:ss) Retrieving a list of powered on guests...."
 
Add-Content $logfile ""
 
$poweredonguests = Get-VM -Location $cluster | where-object {$_.PowerState -eq "PoweredOn" }
 
 
 
Add-Content $logfile "$(get-date -f dd/MM/yyyy) $(get-date -f HH:mm:ss) Checking to see if vCenter is virtualized"
 
 
 
# Retrieve host info for vCenter
 
if ($vcenterVMName -ne "NA")
 
{
 
    Add-Content $logfile "$(get-date -f dd/MM/yyyy) $(get-date -f HH:mm:ss) vCenter is indeed virtualized, getting ESXi host hosting vCenter Server"
 
    $vCenterHost = (Get-VM $vCenterVMName).Host.Name
 
    Add-Content $logfile "$(get-date -f dd/MM/yyyy) $(get-date -f HH:mm:ss) $vCenterVMName currently running on $vCenterHost - will process this last"
 
}
 
else
 
{
 
    Add-Content $logfile "$(get-date -f dd/MM/yyyy) $(get-date -f HH:mm:ss) vCenter is not virtualized"
 
}
 
 
 
Add-Content $logfile "$(get-date -f dd/MM/yyyy) $(get-date -f HH:mm:ss) Proceeding with VM PowerOff"
 
Add-Content $logfile ""
 
 
 
# And now, let's start powering off some guests....
 
ForEach ( $guest in $poweredonguests )
 
{
 
    if ($guest.Name -notmatch $vCenterVMName -and $guest.Name -notmatch $StarWindVM1 -and $guest.Name -notmatch $StarWindVM2)
 
    {
 
        Write-Host "Processing $guest.... " -ForegroundColor Green
 
        Write-Host "Checking for VMware tools install" -Foregroundcolor Green
 
        $guestinfo = get-view -Id $guest.ID
 
        if ($guestinfo.config.Tools.ToolsVersion -eq 0)
 
        {
 
            Write-Host "No VMware tools detected in $guest , hard power this one" -ForegroundColor Yellow
 
            Write-Host ""
 
            Add-Content $logfile "$(get-date -f dd/MM/yyyy) $(get-date -f HH:mm:ss) $guest - no VMware tools, hard power off"
 
            Stop-VM $guest -confirm:$false | out-null
 
        }
 
        else
 
        {
 
           write-host "VMware tools detected.  I will attempt to gracefully shutdown $guest"
 
           Write-Host ""
 
           Add-Content $logfile "$(get-date -f dd/MM/yyyy) $(get-date -f HH:mm:ss) $guest - VMware tools installed, gracefull shutdown"
 
           $vmshutdown = $guest | shutdown-VMGuest -Confirm:$false | out-null
 
        }
 
    }
 
}
 
 
 
# Let's wait a minute or so for shutdowns to complete
 
Write-Host ""
 
Write-Host "Giving VMs 2 minutes before resulting in hard power off"
 
Write-Host ""
 
Add-Content $logfile ""
 
Add-Content $logfile "$(get-date -f dd/MM/yyyy) $(get-date -f HH:mm:ss) Waiting a couple minutes then hard powering off all remaining VMs"
 
Sleep 120
 
 
 
# Now, let's go back through again to see if anything is still powered on and shut it down if it is
 
Write-Host "Beginning Phase 2 - anything left on.... night night...." -ForegroundColor red
 
Write-Host ""
 
 
 
# Get our list of guests still powered on...
 
 
 
$poweredonguests = Get-VM -Location $cluster | where-object {$_.PowerState -eq "PoweredOn" }
 
 
 
if ($poweredonguests -ne $null)
 
{
 
    ForEach ( $guest in $poweredonguests )
 
    {
 
        if ($guest.Name -notmatch $vCenterVMName -and $guest.Name -notmatch $StarWindVM1 -and $guest.Name -notmatch $StarWindVM2)
 
        {
 
            Write-Host "Processing $guest ...." -ForegroundColor Green
 
            #no checking for toosl, we just need to blast it down...
 
            write-host "Shutting down $guest - I don't care, it just needs to be off..." -ForegroundColor Yellow
 
                        Write-Host ""
 
            Add-Content $logfile "$(get-date -f dd/MM/yyyy) $(get-date -f HH:mm:ss) $guest - Hard Power Off"
 
            Stop-VM $guest -confirm:$false | out-null
 
        }
 
    }
 
}
 
 
 
# Wait 30 seconds
 
Write-Host "Waiting 30 seconds and then proceeding with host power off"
 
Write-Host ""
 
Sleep 30
 
Write-Host "Putting StarWind devices in to Maintenance Mode "
 
Write-Host ""
 
 
 
 
 
#Getting StarWind devices in to "Maintenance Mode"
 
Import-Module StarWindX
 
 
 
try
 
{
 
    $server = New-SWServer -host $StarWind -port 3261 -user root -password starwind
 
    $server.Connect()
 
    write-host "Devices:" -foreground yellow
 
   
 
    foreach($device in $server.Devices){
 
        if( !$device ){
 
            Write-Host "No device found" -foreground red
 
            return
 
        } else {
 
            $device.Name
 
            $disk = $device.Name
 
            if ($device.Name -like "HAimage*"){
 
                $device.SwitchMaintenanceMode($true, $true)
 
                write-host "$disk entered maintenance mode"
 
            } else {
 
                write-host "$disk is not an HA device, maintenance mode is not supported"
 
            }
 
        }
 
    }
 
}
 
catch
 
{
 
       Write-Host $_ -foreground red
 
}
 
finally
 
{
 
       $server.Disconnect()
 
}
 
 
 
Enter-PSSession -ComputerName $StarWindVM1 -Credential Administrator
 
 
 
$action = New-ScheduledTaskAction -Execute 'Powershell.exe' -Argument '-ExecutionPolicy Bypass c:\SW_Maintenance_Off.ps1 -RunType $true -Path c:\SW_Maintenance_Off.ps1.ps1'
 
 
 
$trigger = New-ScheduledTaskTrigger -AtStartup -RandomDelay 00:00:30
 
 
 
$settings = New-ScheduledTaskSettingsSet -Compatibility Win8
 
 
 
$principal = New-ScheduledTaskPrincipal -UserId SYSTEM -LogonType ServiceAccount -RunLevel Highest
 
 
 
$definition = New-ScheduledTask -Action $action -Principal $principal -Trigger $trigger -Settings $settings -Description "Maintenance Mode"
 
 
 
Register-ScheduledTask -TaskName "Maintenance Mode off" -InputObject $definition
 
 
 
 
 
Add-Content $logfile ""
 
Add-Content $logfile "$(get-date -f dd/MM/yyyy) $(get-date -f HH:mm:ss) Processing power off of all hosts now"
 
Sleep 30
 
 
 
# and now its time to slam down the hosts - I've chosen to go by datacenter here but you could put the cluster
 
# There are some standalone hosts in the datacenter that I would also like to shutdown, those vms are set to
 
# start and stop with the host, so i can just shut those hosts down and they will take care of the vm shutdown
 
 
 
shutdown-VMGuest $vCenterVMName -Confirm:$false
 
Write-Host "Waiting for vCenter shutdown" -ForegroundColor Green
 
Add-Content $logfile "$(get-date -f dd/MM/yyyy) $(get-date -f HH:mm:ss) Shutting down $vCenterVMName"
 
Sleep 300
 
 
 
Connect-VIServer $ESXIhost1 -Credential $credentials4host -WarningAction:SilentlyContinue
 
        Write-Host "Shutting down $ESXIhost1" -ForegroundColor Green
 
        Add-Content $logfile "$(get-date -f dd/MM/yyyy) $(get-date -f HH:mm:ss) Shutting down $ESXIhost1"
 
        Stop-VMHost $ESXIhost1 -Confirm:$false -Force
 
Sleep 120
 
 
 
Connect-VIServer $ESXIhost2 -Credential $credentials4host -WarningAction:SilentlyContinue
 
        Write-Host "Shutting down $ESXIhost2" -ForegroundColor Green
 
        Add-Content $logfile "$(get-date -f dd/MM/yyyy) $(get-date -f HH:mm:ss) Shutting down $ESXIhost2"
 
        Stop-VMHost $ESXIhost2 -Confirm:$false -Force
 
 
 
Add-Content $logfile ""
 
Add-Content $logfile "$(get-date -f dd/MM/yyyy) $(get-date -f HH:mm:ss) All done!"
 
# That's a wrap

 

NOTE: Install Power-CLI to use this script: Log in to StarWind VM and install vSphere PowerCLI on each StarWind virtual machine by adding the PowerShell module (Internet connectivity is required). To do so, run the following command in PowerShell:

Install-Module -Name VMware.PowerCLI -AllowClobber

 

 

Exit StarWind Maintenance Mode

To turn off the StarWind Maintenance Mode, put the following script directly to C:\ and name it as SW_Maintenance_Off.ps1.

Write-Host "Waiting untill service is starting"
 
$ServiceName = 'StarWindService'
 
$StarWind = 'SW-HCA-VM-01' #specify your StarWind VM (or host) ip-address
 
 $arrService = Get-Service -Name $ServiceName
 
 if ($arrService.Status -ne "Running"){
 
 Start-Service $ServiceName
 
 Write-Host "Starting " $ServiceName " service"
 
 " ---------------------- "
 
 " Service is now started"
 
 }
 
 if ($arrService.Status -eq "running"){
 
 Write-Host "$ServiceName service is already started"
 
 
 
 
 
#Getting StarWind devices in to "Maintenance Mode"
 
Import-Module StarWindX
 
 
 
try
 
{
 
    $server = New-SWServer -host $StarWind -port 3261 -user root -password starwind
 
    $server.Connect()
 
    write-host "Devices:" -foreground yellow
 
   
 
    foreach($device in $server.Devices){
 
        if( !$device ){
 
            Write-Host "No device found" -foreground red
 
            return
 
        } else {
 
            $device.Name
 
            $disk = $device.Name
 
            if ($device.Name -like "HAimage*"){
 
                $device.SwitchMaintenanceMode($false, $true)
 
                write-host "$disk exited maintenance mode"
 
            } else {
 
                write-host "$disk is not an HA device, maintenance mode is not supported"
 
            }
 
        }
 
    }
 
}
 
catch
 
{
 
       Write-Host $_ -foreground red
 
}
 
finally
 
{
 
       $server.Disconnect()
 
}
 
 
 
Unregister-ScheduledTask -TaskName "Maintenance Mode off" -Confirm:$false
 
 }

 

Conclusion

The integration of PowerChute offers a robust solution for managing power supply issues in virtualized environments. This setup is essential for the scenarios where power interruptions are a concern. By following the instructions for installing and configuring PowerChute, users can enhance the resilience and reliability of their IT infrastructure against unexpected power disruptions.

Hey! Don’t want to tinker with configuring all the settings? Looking for a fast-track to VSAN deployment?
Dmytro Malynka
Dmytro Malynka StarWind Virtual SAN Product Manager
We've got you covered! First off, all trial and commercial StarWind customers are eligible for installation and configuration assistance services. StarWind engineers will help you spin up the PoC setup to properly evaluate the solution and will assist with the production deployment after the purchase. Secondly, once deployed, StarWind VSAN is exceptionally easy to use and maintain. Hard to believe? Wait no more and book a StarWind VSAN demo now to see it in action!
What’s next?
Product
Virtualization Platform [Hypervisor]
Country
  • Afghanistan (‫افغانستان‬‎)+93
  • Albania (Shqipëri)+355
  • Algeria (‫الجزائر‬‎)+213
  • American Samoa+1
  • Andorra+376
  • Angola+244
  • Anguilla+1
  • Antigua and Barbuda+1
  • Argentina+54
  • Armenia (Հայաստան)+374
  • Aruba+297
  • Ascension Island+247
  • Australia+61
  • Austria (Österreich)+43
  • Azerbaijan (Azərbaycan)+994
  • Bahamas+1
  • Bahrain (‫البحرين‬‎)+973
  • Bangladesh (বাংলাদেশ)+880
  • Barbados+1
  • Belarus (Беларусь)+375
  • Belgium (België)+32
  • Belize+501
  • Benin (Bénin)+229
  • Bermuda+1
  • Bhutan (འབྲུག)+975
  • Bolivia+591
  • Bosnia and Herzegovina (Босна и Херцеговина)+387
  • Botswana+267
  • Brazil (Brasil)+55
  • British Indian Ocean Territory+246
  • British Virgin Islands+1
  • Brunei+673
  • Bulgaria (България)+359
  • Burkina Faso+226
  • Burundi (Uburundi)+257
  • Cambodia (កម្ពុជា)+855
  • Cameroon (Cameroun)+237
  • Canada+1
  • Cape Verde (Kabu Verdi)+238
  • Caribbean Netherlands+599
  • Cayman Islands+1
  • Central African Republic (République centrafricaine)+236
  • Chad (Tchad)+235
  • Chile+56
  • China (中国)+86
  • Christmas Island+61
  • Cocos (Keeling) Islands+61
  • Colombia+57
  • Comoros (‫جزر القمر‬‎)+269
  • Congo (DRC) (Jamhuri ya Kidemokrasia ya Kongo)+243
  • Congo (Republic) (Congo-Brazzaville)+242
  • Cook Islands+682
  • Costa Rica+506
  • Côte d’Ivoire+225
  • Croatia (Hrvatska)+385
  • Cuba+53
  • Curaçao+599
  • Cyprus (Κύπρος)+357
  • Czech Republic (Česká republika)+420
  • Denmark (Danmark)+45
  • Djibouti+253
  • Dominica+1
  • Dominican Republic (República Dominicana)+1
  • Ecuador+593
  • Egypt (‫مصر‬‎)+20
  • El Salvador+503
  • Equatorial Guinea (Guinea Ecuatorial)+240
  • Eritrea+291
  • Estonia (Eesti)+372
  • Eswatini+268
  • Ethiopia+251
  • Falkland Islands (Islas Malvinas)+500
  • Faroe Islands (Føroyar)+298
  • Fiji+679
  • Finland (Suomi)+358
  • France+33
  • French Guiana (Guyane française)+594
  • French Polynesia (Polynésie française)+689
  • Gabon+241
  • Gambia+220
  • Georgia (საქართველო)+995
  • Germany (Deutschland)+49
  • Ghana (Gaana)+233
  • Gibraltar+350
  • Greece (Ελλάδα)+30
  • Greenland (Kalaallit Nunaat)+299
  • Grenada+1
  • Guadeloupe+590
  • Guam+1
  • Guatemala+502
  • Guernsey+44
  • Guinea (Guinée)+224
  • Guinea-Bissau (Guiné Bissau)+245
  • Guyana+592
  • Haiti+509
  • Honduras+504
  • Hong Kong (香港)+852
  • Hungary (Magyarország)+36
  • Iceland (Ísland)+354
  • India (भारत)+91
  • Indonesia+62
  • Iran (‫ایران‬‎)+98
  • Iraq (‫العراق‬‎)+964
  • Ireland+353
  • Isle of Man+44
  • Israel (‫ישראל‬‎)+972
  • Italy (Italia)+39
  • Jamaica+1
  • Japan (日本)+81
  • Jersey+44
  • Jordan (‫الأردن‬‎)+962
  • Kazakhstan (Казахстан)+7
  • Kenya+254
  • Kiribati+686
  • Kosovo+383
  • Kuwait (‫الكويت‬‎)+965
  • Kyrgyzstan (Кыргызстан)+996
  • Laos (ລາວ)+856
  • Latvia (Latvija)+371
  • Lebanon (‫لبنان‬‎)+961
  • Lesotho+266
  • Liberia+231
  • Libya (‫ليبيا‬‎)+218
  • Liechtenstein+423
  • Lithuania (Lietuva)+370
  • Luxembourg+352
  • Macau (澳門)+853
  • Madagascar (Madagasikara)+261
  • Malawi+265
  • Malaysia+60
  • Maldives+960
  • Mali+223
  • Malta+356
  • Marshall Islands+692
  • Martinique+596
  • Mauritania (‫موريتانيا‬‎)+222
  • Mauritius (Moris)+230
  • Mayotte+262
  • Mexico (México)+52
  • Micronesia+691
  • Moldova (Republica Moldova)+373
  • Monaco+377
  • Mongolia (Монгол)+976
  • Montenegro (Crna Gora)+382
  • Montserrat+1
  • Morocco (‫المغرب‬‎)+212
  • Mozambique (Moçambique)+258
  • Myanmar (Burma) (မြန်မာ)+95
  • Namibia (Namibië)+264
  • Nauru+674
  • Nepal (नेपाल)+977
  • Netherlands (Nederland)+31
  • New Caledonia (Nouvelle-Calédonie)+687
  • New Zealand+64
  • Nicaragua+505
  • Niger (Nijar)+227
  • Nigeria+234
  • Niue+683
  • Norfolk Island+672
  • North Korea (조선 민주주의 인민 공화국)+850
  • North Macedonia (Северна Македонија)+389
  • Northern Mariana Islands+1
  • Norway (Norge)+47
  • Oman (‫عُمان‬‎)+968
  • Pakistan (‫پاکستان‬‎)+92
  • Palau+680
  • Palestine (‫فلسطين‬‎)+970
  • Panama (Panamá)+507
  • Papua New Guinea+675
  • Paraguay+595
  • Peru (Perú)+51
  • Philippines+63
  • Poland (Polska)+48
  • Portugal+351
  • Puerto Rico+1
  • Qatar (‫قطر‬‎)+974
  • Réunion (La Réunion)+262
  • Romania (România)+40
  • Russia (Россия)+7
  • Rwanda+250
  • Saint Barthélemy+590
  • Saint Helena+290
  • Saint Kitts and Nevis+1
  • Saint Lucia+1
  • Saint Martin (Saint-Martin (partie française))+590
  • Saint Pierre and Miquelon (Saint-Pierre-et-Miquelon)+508
  • Saint Vincent and the Grenadines+1
  • Samoa+685
  • San Marino+378
  • São Tomé and Príncipe (São Tomé e Príncipe)+239
  • Saudi Arabia (‫المملكة العربية السعودية‬‎)+966
  • Senegal (Sénégal)+221
  • Serbia (Србија)+381
  • Seychelles+248
  • Sierra Leone+232
  • Singapore+65
  • Sint Maarten+1
  • Slovakia (Slovensko)+421
  • Slovenia (Slovenija)+386
  • Solomon Islands+677
  • Somalia (Soomaaliya)+252
  • South Africa+27
  • South Korea (대한민국)+82
  • South Sudan (‫جنوب السودان‬‎)+211
  • Spain (España)+34
  • Sri Lanka (ශ්‍රී ලංකාව)+94
  • Sudan (‫السودان‬‎)+249
  • Suriname+597
  • Svalbard and Jan Mayen+47
  • Sweden (Sverige)+46
  • Switzerland (Schweiz)+41
  • Syria (‫سوريا‬‎)+963
  • Taiwan (台灣)+886
  • Tajikistan+992
  • Tanzania+255
  • Thailand (ไทย)+66
  • Timor-Leste+670
  • Togo+228
  • Tokelau+690
  • Tonga+676
  • Trinidad and Tobago+1
  • Tunisia (‫تونس‬‎)+216
  • Turkey (Türkiye)+90
  • Turkmenistan+993
  • Turks and Caicos Islands+1
  • Tuvalu+688
  • U.S. Virgin Islands+1
  • Uganda+256
  • Ukraine (Україна)+380
  • United Arab Emirates (‫الإمارات العربية المتحدة‬‎)+971
  • United Kingdom+44
  • United States+1
  • Uruguay+598
  • Uzbekistan (Oʻzbekiston)+998
  • Vanuatu+678
  • Vatican City (Città del Vaticano)+39
  • Venezuela+58
  • Vietnam (Việt Nam)+84
  • Wallis and Futuna (Wallis-et-Futuna)+681
  • Western Sahara (‫الصحراء الغربية‬‎)+212
  • Yemen (‫اليمن‬‎)+967
  • Zambia+260
  • Zimbabwe+263
  • Åland Islands+358