Партнерка на США и Канаду по недвижимости, выплаты в крипто

  • 30% recurring commission
  • Выплаты в USDT
  • Вывод каждую неделю
  • Комиссия до 5 лет за каждого referral

  }

  }

  }

  }

  }

  }

}

Приложение 2

JSON файл для восстановления инфраструктуры

{

  "$schema": "https://schema. management. /schemas/2015-01-01/deploymentTemplate. json#",

  "contentVersion": "1.0.0.0",

  "parameters": {

  "networkSecurityGroups_NSG_DR_NE_name": {

  "defaultValue": null,

  "type": "String"

  },

  "virtualNetworks_initial_name": {

  "defaultValue": null,

  "type": "String"

  },

  "storageAccounts_nedrlrs_name": {

  "defaultValue": null,

  "type": "String"

  }

  },

  "variables": {},

  "resources": [

  {

  "type": "work/networkSecurityGroups",

  "name": "[parameters('networkSecurityGroups_NSG_DR_NE_name')]",

  "apiVersion": "2017-03-01",

  "location": "northeurope",

  "properties": {

  "securityRules": [

  {

  "name": "AllowInboundAnyToAny",

  "properties": {

  "protocol": "*",

  "sourcePortRange": "*",

  "destinationPortRange": "*",

  "sourceAddressPrefix": "*",

  "destinationAddressPrefix": "*",

  "access": "Allow",

  "priority": 100,

  "direction": "Inbound"

  }

  },

  {

  "name": "AllowInboundRDP",

  "properties": {

  "protocol": "TCP",

  "sourcePortRange": "*",

  "destinationPortRange": "3389",

  "sourceAddressPrefix": "Internet",

  "destinationAddressPrefix": "*",

НЕ нашли? Не то? Что вы ищете?

  "access": "Allow",

  "priority": 110,

  "direction": "Inbound"

  }

  },

  {

  "name": "AllowOutboundAnyToAny",

  "properties": {

  "protocol": "*",

  "sourcePortRange": "*",

  "destinationPortRange": "*",

  "sourceAddressPrefix": "*",

  "destinationAddressPrefix": "*",

  "access": "Allow",

  "priority": 100,

  "direction": "Outbound"

  }

  }

  ]

  },

  "dependsOn": []

  },

  {

  "type": "work/virtualNetworks",

  "name": "[parameters('virtualNetworks_initial_name')]",

  "apiVersion": "2017-03-01",

  "location": "northeurope",

  "properties": {

  "addressSpace": {

  "addressPrefixes": [

  "10.10.5.0/24"

  ]

  },

  "dhcpOptions": {

  "dnsServers": [

  "10.10.5.4"

  ]

  },

  "subnets": [

  {

  "name": "production",

  "properties": {

  "addressPrefix": "10.10.5.0/27"

  }

  },

  {

  "name": "GatewaySubnet",

  "properties": {

  "addressPrefix": "10.10.5.32/28"

  }

  }

  ],

  "virtualNetworkPeerings": []

  },

  "dependsOn": []

  },

  {

  "type": "Microsoft. Storage/storageAccounts",

  "sku": {

  "name": "Standard_LRS",

  "tier": "Standard"

  },

  "kind": "Storage",

  "name": "[parameters('storageAccounts_nedrlrs_name')]",

  "apiVersion": "2016-01-01",

  "location": "northeurope",

  "tags": {},

  "properties": {},

  "dependsOn": []

  }

  ]

}

Приложение 3

Скрипт конфигурации виртуальных машин после аварийного восстановления (Failover)

Имя: ConfigureServerAfterFailover

workflow ConfigureServerAfterFailover{

# Get the connection "AzureRunAsConnection"

  $connectionName = "AzureRunAsConnection"

  try

  {

  $servicePrincipalConnection=Get-AutomationConnection - Name $connectionName 

  "Logging in to Azure..."

  Add-AzureRmAccount `

  - ServicePrincipal `

  - TenantId $servicePrincipalConnection. TenantId `

  - ApplicationId $servicePrincipalConnection. ApplicationId `

  - CertificateThumbprint $servicePrincipalConnection. CertificateThumbprint

  }

  catch {

  if (!$servicePrincipalConnection)

  {

  $ErrorMessage = "Connection $connectionName not found."

  throw $ErrorMessage

  } else{

  Write-Error - Message $_.Exception

  throw $_.Exception

  }

}

$location = "Southeastasia"

$resourceGroupName = "RG-DR-SA"

$resources = @(Get-AzureRmResource | where {$_.ResourceType - like "Microsoft.*/virtualMachines" - and $_.Location - match $location - and $_.ResourceGroupName - eq $resourceGroupName} | sort Name)

foreach - parallel($vmresource in $resources){

  sequence{

  InlineScript{

  $inlineResource = $Using:vmresource

  $VMName = $inlineResource. Name

  $OldVM = Get-AzureRmVM - Name $inlineResource. Name - ResourceGroupName $inlineResource. ResourceGroupName

  $Location = $OldVM. Location

  $VMRGName = $OldVM. ResourceGroupName

  $VMSize = $OldVM. HardwareProfile. VmSize

  $NICName = $workInterfaceIDs - split '/'

  $NICName = $NICName[$NICName. Count-1]

  $VMStatus = $(Get-AzureRmVM - ResourceGroupName $OldVM. ResourceGroupName - Name $OldVM. Name - Status).Statuses[1].DisplayStatus

  # Stopping VM

  if ($VMStatus - notmatch "deallocated"){

  Write-Output "Stopping VM $VMName"

  Stop-AzureRmVM - ResourceGroupName $VMRGName - Name $vmName - Force - Verbose

  }else{

  Write-Output "VM is already stopped"

  }

  # delete VM

  Write-Output "Deleting the $VMName started"

  Remove-AzureRmVM - ResourceGroupName $VMRGName - Name $VMName - Force - Verbose

  # delete NIC

  Write-Output "Deleting OLD NIC started"

  $oldnic = Get-AzureRmNetworkInterface - Name $NICName - ResourceGroupName $OldVM. ResourceGroupName

  Remove-AzureRmNetworkInterface - Name $NICName - ResourceGroupName $OldVM. ResourceGroupName - Force - Verbose

  $PIPName = $oldnic. IpConfigurations. PublicIpAddress. Id - split '/'

  $PIPName = $PIPName[$PIPName. Count-1]

  # delete old PIP

  Write-Host "Deleting OLD PIP started"

  Remove-AzureRmPublicIpAddress - Name $PIPName - ResourceGroupName $OldVM. ResourceGroupName - Force - Verbose

  # recreate PIP

  Write-Output "Creating NEW PIP started"

  $pip = New-AzureRmPublicIpAddress - ResourceGroupName $VMRGName `

  - Location $Location `

  - AllocationMethod Static `

  - Name "PIP-$VMName" `

  - Verbose

  # Create the NIC

  Write-Output "Creating NEW NIC started"

  $NICName = $VMName + 'i01pr'

  $NIC = New-AzureRmNetworkInterface  - Name $NICName `

  - ResourceGroupName $VMRGName `

  - PublicIpAddressId $pip. Id `

  - Location $Location `

  - SubnetId $oldnic. bnet. Id `

  - PrivateIpAddress $oldnic. IpConfigurations. PrivateIpAddress `

  - DnsServer $oldnic. DnsSettings. DnsServers `

  - NetworkSecurityGroupId $workSecurityGroup. Id `

  - Force `

  - Verbose

  $NewDiskName = $VMName + "DISKOS01"

  $storageAccount = $oldvm. StorageProfile. OsDisk. Vhd. Uri - split '/'

  $storageAccount = $storageAccount[2]

  $storageAccount = $storageAccountsplit '\.'

  $storageAccount = $storageAccount[0]

  $storageAccountResourceGroup = $(Get-AzureRmStorageAccountResourceGroupName $OldVM. ResourceGroupName - Name $storageAccount).ResourceGroupName

  $storageAccountKey = $(Get-AzureRmStorageAccountKey - ResourceGroupName $storageAccountResourceGroup - name $storageAccount).Value[0]

  $diskBlob = $oldvm. StorageProfile. OsDisk. Vhd. Uri - split '/'

  $diskBlob = $diskBlob[$diskBlob. Count-1]

  $backupDiskBlob = "$NewDiskName. vhd"

  $NewDiskBlob = "$NewDiskName. vhd"

  $srcContainer = $oldvm. StorageProfile. OsDisk. Vhd. Uri - split '/'

  $srcContainer = $srcContainer[$srcContainer. Count-2]

  $vhdUri = $oldvm. StorageProfile. OsDisk. Vhd. Uri

  $NewvhdUri = "https://$storageAccount. blob. core. /$srcContainer/$NewDiskBlob"

  ### Copy OS disk with new name

  $ctx = New-AzureStorageContext - StorageAccountName $storageAccountStorageAccountKey $storageAccountKey

  $blobCount = Get-AzureStorageBlob - Container $srcContainer - Context $ctx | where { $_.Name - eq $backupDiskBlob } | Measure | % { $_.Count }

  if ($blobCount - eq 0)

  {

  Start-AzureStorageBlobCopy - SrcBlob $diskBlob - SrcContainer $srcContainer - DestContainer $srcContainer - DestBlob $NewDiskBlob - Context $ctx - Force

  Get-AzureStorageBlobCopyState - Container $srcContainer - Blob $NewDiskBlob - Context $ctx - WaitForComplete

  }

  else{

  Write-Ouput "The disk $NewDiskBlob already exists, please check the disk"

  Pause

  break

  }

  ### Copy DATA disks with new name

  if ($OldVM. StorageProfile. DataDisks. Count - ne 0){

  $isDataDisksExists = $true

  $DTDisksAmnt = $($oldvm. StorageProfile. DataDisks. lun[-1]) + 1

  $VhdUri = $oldvm. StorageProfile. DataDisks. Vhd. Uri - split '/'

  $VhdUri = $VMName + 'DISKDATA'

  $AttchAmnt = $null

  For ($AttchAmnt = 1; $AttchAmnt - le $DTDisksAmnt; $AttchAmnt++){

  If ($AttchAmnt - lt 10){

  $VhdUrin = $VhdUri + '0' + $AttchAmnt + '.vhd'

  }

  else{

  $VhdUrin = $VhdUri + $AttchAmnt + '.vhd'

  }

  $Lun = $AttchAmnt - 1

  if ( ($oldvm. StorageProfile. DataDisks. Vhd. Uri | Measure-Object).count - eq 1){

  $DataDiskBlob = $oldvm. StorageProfile. DataDisks. Vhd. Uri - split '/'

  }

  else {

  $DataDiskBlob = $oldvm. StorageProfile. DataDisks. Vhd. Uri[$Lun] - split '/'

  }

  $DataDiskBlob = $DataDiskBlob[4]

  $DiskName = $($DataDiskBlob - split "\.")[0]

  $blobCount = Get-AzureStorageBlob - Container $srcContainer - Context $ctx | where { $_.Name - eq $DTDSKName } | Measure | % { $_.Count }

  if ($blobCount - eq 0)

  {

  $blob1 = Start-AzureStorageBlobCopy - SrcBlob $DataDiskBlob - SrcContainer $srcContainer - DestContainer $srcContainer - DestBlob $VhdUrin - Context $ctx - Force

  Get-AzureStorageBlobCopyState - Container $srcContainer - Blob $VhdUrin - Context $ctx - WaitForComplete

  ### Retrieve the current status of the copy operation ###

  $status = $blob1 | Get-AzureStorageBlobCopyState

  ### Print out status ###

  $status

  ### Loop until complete ### 

  While($status. Status - ne "Success"){

  $status = $blob1 | Get-AzureStorageBlobCopyState

  Start-Sleep 10

  ### Print out status ###

  $status

  }

  }

  }

  }

  else {

  Write-Output "This VM doesn't have Data Disks" - ForegroundColor Magenta

  }

  # recreate VM

  $vm = New-AzureRmVMConfig - VMName $OldVM. Name - VMSize $OldVM. HardwareProfile. VmSize

  $vm = Add-AzureRmVMNetworkInterface - VM $vm - Id $NIC. Id

  $vm = Set-AzureRmVMOSDisk - VM $vm - Name $NewDiskName - VhdUri $NewvhdUri - CreateOption attach - Windows

  #Attach DATA disks

  if ($isDataDisksExists){

  $DTDisksAmnt = $($oldvm. StorageProfile. DataDisks. lun[-1]) + 1

  $VhdUri = $oldvm. StorageProfile. OsDisk. Vhd. Uri - split '/'

  $VhdUri = $VhdUri[0] + '/' + $VhdUri[1] + '/' + $VhdUri[2] + '/' + $VhdUri[3] + '/' + $VMName + 'DISKDATA'

  $AttchAmnt = $null

  For ($AttchAmnt = 1; $AttchAmnt - le $DTDisksAmnt; $AttchAmnt++){

  If ($AttchAmnt - lt 10){

  $VhdUrin = $VhdUri + '0' + $AttchAmnt + '.vhd'

  }

  else{

  $VhdUrin = $VhdUri + $AttchAmnt + '.vhd'

  }

  $DTDSKName = $VhdUrin - Split '/'

  $DTDSKName = $DTDSKName[-1]

  $DTDSKName = $DTDSKName - split '\.'

  $DTDSKName = $DTDSKName[0]

  $Lun = $AttchAmnt - 1

  Add-AzureRmVMDataDisk - VM $VM - DiskSizeInGB $oldvm. StorageProfile. DataDisks[$Lun].DiskSizeGB - VhdUri $VhdUrin - Name $DTDSKName - Lun $Lun - CreateOption attach

  }

  }

  Write-Output "Creating NEW VM started"

  New-AzureRmVM - ResourceGroupName $VMRGName - Location $location - VM $vm - DisableBginfoExtension - Verbose 

  # Remove disks in old storage account

  $DisksDelete = 'NO', 'YES'

  $DisksDelete =

  $DisksDelete | Out-Gridview `

  - Title "Do you want to delete old Disk(s) ? " `

  - PassThru

  if ($DisksDelete - eq 'YES')

  {

  Remove-AzureStorageBlob - Blob $diskBlob - Container $srcContainer - Context $ctx - Verbose

  Write-Output "Old OS disk has been deleted"

  $DataDisks = $OldVM. StorageProfile. DataDisks

  foreach ($Disk in $DataDisks){

  Remove-AzureStorageBlob - Blob $($Disk. Name + '.vhd') - Container $srcContainer - Context $ctx - Verbose

  }

  Write-Output "Old DATA disks is deleted"

  }

  }

  }

  } 

}



1 Георепликация - хранение копии данных одного региона в другом.

2 BLOB-объект – файл любого типа и размера. Бывают нескольких видов: блочные, добавочные большие двоичные BLOB-объекты и страничные.

3 REST API (Representational State Transfer Application Programming Interface) - архитектурный стиль взаимодействия компонентов распределённого приложения в сети. REST представляет собой согласованный набор ограничений, учитываемых при проектировании распределённой гипермедиа-системы.

4 ЦОД – центр обработки данных

5 LLD (Low Level Design) – низкоуровневый дизайн инфраструктуры

6 См. Приложение 1

7 См. Приложение 3

Из за большого объема этот материал размещен на нескольких страницах:
1 2 3 4 5 6