- determine the number of servers and IP address you need
- determine number of private hosts first
- 10.0.0.0/8 (24-bit; Class A)
- 172.16.0.0/12 (20-bit; 16 Class B blocks)
- 192.168.0.0/16 (16-bit; 256 Class C blocks)
 
- use route summarization for better routing performance and management
- 192.168.0.0/24 and 192.168.1.0/24 could be 192.168.0.0/23, spanning both (borrowing a bit)
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #!/usr/bin/env bash | |
| ##################################################### | |
| # SETUP (OPTIONAL) | |
| # | |
| # Note: this code is not meant to just run; | |
| # copy and paste snippets as you go. | |
| ##################################################### | |
| export PROJECT_ID=$(gcloud config get-value project) | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #!/usr/bin/env bash | |
| ##################################################################### | |
| # REFERENCES | |
| # - https://cloud.google.com/compute/docs/instances/create-start-instance | |
| # - https://cloud.google.com/compute/docs/disks/create-snapshots | |
| # - https://cloud.google.com/compute/docs/disks/restore-snapshot | |
| ##################################################################### | |
| export PROJECT_ID=$(gcloud config get-value project) | |
| export PROJECT_USER=$(gcloud config get-value core/account) # set current user | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #!/usr/bin/env bash | |
| ##################################################################### | |
| # REFERENCES | |
| # - https://cloud.google.com/compute/docs/instances/create-start-instance | |
| # - https://cloud.google.com/compute/docs/disks/create-snapshots | |
| # - https://cloud.google.com/compute/docs/disks/restore-snapshot | |
| ##################################################################### | |
| export PROJECT_ID=$(gcloud config get-value project) | |
| export PROJECT_USER=$(gcloud config get-value core/account) # set current user | 
Follow [steps][1]:
- Download: http://download.microsoft.com/download/9/1/E/91E9F42C-3F1F-4AD9-92B7-8DD65DA3B0C2/mvmc_setup.msi (thanks @xavery)
- Open Powershell as administrator and run
Import-Module 'C:\Program Files\Microsoft Virtual Machine Converter\MvmcCmdlet.psd1'
- And after
ConvertTo-MvmcVirtualHardDisk -SourceLiteralPath d:\scratch\vmx\VM-disk1.vmdk -VhdType DynamicHardDisk -VhdFormat vhdx -destination c:\vm-disk1
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #!/usr/bin/env bash | |
| APP_NAME="quota-monitoring" | |
| SVC_ACCT_NAME="$APP_NAME-sa" | |
| CURRENT_USER=$(gcloud config get-value core/account) | |
| function configure() { | |
| echo "Setting environment variables ..." | |
| read -p "Enter base domain for org (without .com) [example]: " DOMAIN | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #!/usr/bin/env bash | |
| ##################################################################### | |
| # REFERENCES | |
| # - https://cloud.google.com/secret-manager/docs/create-secret-quickstart | |
| # - https://cloud.google.com/secret-manager/docs/manage-access-to-secrets | |
| # - https://cloud.google.com/secret-manager/docs/creating-and-managing-expiring-secrets | |
| # - https://cloud.google.com/secret-manager/docs/secret-rotation | |
| # - https://cloud.google.com/compute/docs/access/create-enable-service-accounts-for-instances | |
| # - https://cloud.google.com/iam/docs/best-practices-service-accounts#single-purpose | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | ##################################################################### | |
| # ORG POLICIES (SET ON DEMO PARENT FOLDER FOR DEMO [SHOULD SET ON ORG]) | |
| # REF: https://cloud.google.com/resource-manager/docs/organization-policy/org-policy-constraints#how-to_guides | |
| # REF: https://cloud.google.com/storage/docs/org-policy-constraints | |
| ##################################################################### | |
| # disable external IPs for VMs | |
| export IP_POLICY_FILE=policy-extip.json | |
| cat > $IP_POLICY_FILE << EOF | |
| { | |
| "constraint": "constraints/compute.vmExternalIpAccess", | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #!/usr/bin/env bash | |
| ##################################################################### | |
| # REFERENCES | |
| # - https://cloud.google.com/sql/docs/postgres/configure-private-ip | |
| # - https://cloud.google.com/build/docs/private-pools/set-up-private-pool-to-use-in-vpc-network#setup-private-connection | |
| # - https://cloud.google.com/network-connectivity/docs/vpn/how-to/creating-ha-vpn2#gcloud | |
| # - https://cloud.google.com/network-connectivity/docs/vpn/how-to/creating-ha-vpn (optional with peering) | |
| ##################################################################### | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #!/usr/bin/env bash | |
| ##################################################################### | |
| # REFERENCES | |
| # - https://cloud.google.com/sdk/gcloud/reference/compute/networks/create | |
| # - https://cloud.google.com/sdk/gcloud/reference/compute/networks/subnets/create | |
| # - https://cloud.google.com/vpc/docs/configure-private-google-access | |
| # - https://cloud.google.com/network-connectivity/docs/router/how-to/create-router-vpc-network#gcloud | |
| # - https://cloud.google.com/nat/docs/set-up-manage-network-address-translation | |
| # - https://cloud.google.com/nat/docs/using-nat-rules | 
NewerOlder