U kunt netwerk-, beveiligings- en load-balancerresources en -instellingen gebruiken in Automation Assembler-blueprintontwerpen en -implementaties.
Zie vRealize Automation Resource Type Schema voor een samenvatting van de opties voor cloudsjabloonontwerpcode.
Deze voorbeelden tonen de resources voor netwerk, beveiliging en load balancer in een standaardontwerp van cloudsjablonen.
Netwerken
| Resourcescenario | Voorbeeldontwerpcode voor cloudsjabloon |
|---|---|
| vSphere-machine met meerdere NIC's die zijn verbonden met vSphere- en NSX-netwerken met DHCP IP-toewijzing | resources:
demo-machine:
type: Cloud.vSphere.Machine
properties:
image: ubuntu
flavor: small
networks:
- network: ${resource["demo-vSphere-Network"].id}
deviceIndex: 0
- network: ${resource["demo-NSX-Network"].id}
deviceIndex: 1
demo-vSphere-Network:
type: Cloud.vSphere.Network
properties:
networkType: existing
demo-NSX-Network:
type: Cloud.NSX.Network
properties:
networkType: outbound
|
NSX-privénetwerk met de eigenschap vlanIds om een array van 3 VLAN's (123, 456 en 7) op te geven |
formatVersion: 1
inputs: {}
resources:
Cloud_Machine_1:
type: Cloud.Machine
properties:
image: test
flavor: test
networks:
- network: '${resource.Cloud_NSX_Network_1.id}'
Cloud_NSX_Network_1:
type: Cloud.NSX.Network
properties:
networkType: private
vlanIds:
- 123
- 456
- 7
|
| Een privénetwerk met een statisch IP-adres voor een Azure VM-implementatie toevoegen | formatVersion: 1
inputs: {}
resources:
Cloud_Azure_Machine_1:
type: Cloud.Machine
properties:
image: photon
flavor: Standard_B1ls
networks:
- network: '${resource.Cloud_Network_1.id}'
assignment: static
address: 10.0.0.45
assignPublicIpAddress: false
Cloud_Network_1:
type: Cloud.Network
properties:
networkType: existing
|
| U kunt een vast toegewezen IP-adres gebruiken met VMware Aria Automation IPAM (intern zoals geleverd door VMware Aria Automation of extern op basis van de VMware Aria Automation IPAM SDK, zoals voor een van de Infoblox-invoegtoepassingen die beschikbaar zijn in de VMware Marketplace). Andere gebruiken van |
resources:
demo_vm:
type: Cloud.vSphere.Machine
properties:
image: 'photon'
cpuCount: 1
totalMemoryMB: 1024
networks:
- network: ${resource.demo_nw.id}
assignment: static
demo_nw:
type: Cloud.vSphere.Network
properties:
networkType: existing |
Voeg regels voor NAT en DNAT port mapping toe of bewerk deze in een Cloud.NSX.NAT-resource voor een bestaande implementatie. |
resources:
gw:
type: Cloud.NSX.Gateway
properties:
networks:
- ${resource.akout.id}
nat:
type: Cloud.NSX.Nat
properties:
networks:
- ${resource.akout.id}
natRules:
- translatedInstance: ${resource.centos.networks[0].id}
index: 0
protocol: TCP
kind: NAT44
type: DNAT
sourceIPs: any
sourcePorts: 80
translatedPorts: 8080
destinationPorts: 8080
description: edit
- translatedInstance: ${resource.centos.networks[0].id}
index: 1
protocol: TCP
kind: NAT44
type: DNAT
sourceIPs: any
sourcePorts: 90
translatedPorts: 9090
destinationPorts: 9090
description: add
gateway: ${resource.gw.id}
centos:
type: Cloud.vSphere.Machine
properties:
image: WebTinyCentOS65x86
flavor: small
customizationSpec: Linux
networks:
- network: ${resource.akout.id}
assignment: static
akout:
type: Cloud.NSX.Network
properties:
networkType: outbound
constraints:
- tag: nsxt-nat-1-M2
|
| Publieke cloudmachine gebruikt een intern IP-adres in plaats van een openbaar IP. In dit voorbeeld wordt een specifieke netwerk-ID gebruikt. N.b: de optie |
resources:
wf_proxy:
type: Cloud.Machine
properties:
image: ubuntu 16.04
flavor: small
constraints:
- tag: 'platform:vsphere'
networks:
- network: '${resource.wf_net.id}'
assignPublicIpAddress: false |
| Gerouteerd netwerk met behulp van het NSX-netwerkresourcetype. |
Cloud_NSX_Network_1:
type: Cloud.NSX.Network
properties:
networkType: routed |
| Voeg een tag toe aan een machine-NIC-resource in de cloudsjabloon. | formatVersion: 1
inputs: {}
resources:
Cloud_Machine_1:
type: Cloud.vSphere.Machine
properties:
flavor: small
image: ubuntu
networks:
- name: '${resource.Cloud_Network_1.name}'
deviceIndex: 0
tags:
- key: 'nic0'
value: null
- key: internal
value: true
- name: '${resource.Cloud_Network_2.name}'
deviceIndex: 1
tags:
- key: 'nic1'
value: null
- key: internal
value: false |
| Tag logische schakelopties van NSX-T voor een uitgaand netwerk. Taggen wordt ondersteund voor NSX-T en VMware Cloud on AWS. Voor meer informatie over dit scenario verwijzen we u naar het blogbericht Creating Tags in NSX in de community. |
Cloud_NSX_Network_1:
type: Cloud.NSX.Network
properties:
networkType: outbound
tags:
- key: app
value: opencart
|
Beveiligingsgroepen
| Resourcescenario | Voorbeeldontwerpcode voor cloudsjabloon |
|---|---|
| Bestaande beveiligingsgroep met een beperkingstag die wordt toegepast op een machine-NIC. Als u een bestaande beveiligingsgroep wilt gebruiken, voert u bestaand in voor de eigenschap securityGroupType . U kunt tags toewijzen aan een Cloud.SecurityGroup-resource om bestaande beveiligingsgroepen toe te wijzen met behulp van tagbeperkingen. Beveiligingsgroepen die geen tags bevatten, kunnen niet worden gebruikt in het cloudsjabloonontwerp. Beperkingstags moeten worden ingesteld voor |
formatVersion: 1
inputs: {}
resources:
allowSsh_sg:
type: Cloud.SecurityGroup
properties:
securityGroupType: existing
constraints:
- tag: allowSsh
compute:
type: Cloud.Machine
properties:
image: centos
flavor: small
networks:
- network: '${resource.prod-net.id}'
securityGroups:
- '${resource.allowSsh_sg.id}'
prod-net:
type: Cloud.Network
properties:
networkType: existing |
| Beveiligingsgroep op aanvraag met twee firewallregels die de |
resources:
Cloud_SecurityGroup_1:
type: Cloud.SecurityGroup
properties:
securityGroupType: new
rules:
- ports: 5000
source: 'fc00:10:000:000:000:56ff:fe89:48b4'
access: Allow
direction: inbound
name: allow_5000
protocol: TCP
- ports: 7000
source: 'fc00:10:000:000:000:56ff:fe89:48b4'
access: Deny
direction: inbound
name: deny_7000
protocol: TCP
Cloud_vSphere_Machine_1:
type: Cloud.vSphere.Machine
properties:
image: photon
cpuCount: 1
totalMemoryMB: 256
networks:
- network: '${resource.Cloud_Network_1.id}'
assignIPv6Address: true
assignment: static
securityGroups:
- '${resource.Cloud_SecurityGroup_1.id}'
Cloud_Network_1:
type: Cloud.Network
properties:
networkType: existing
|
|
Complexe cloudsjabloon met 2 beveiligingsgroepen, waaronder:
In dit voorbeeld ziet u verschillende combinaties van protocollen en poorten, services, IP CIDR als bron en doel, IP-bereik als bron of bestemming, en de opties voor alle, IPv6 en (::/0). Voor machine-NIC's kunt u het verbonden netwerk en de beveiligingsgroep(en) opgeven. U kunt ook de NIC-index of een IP-adres opgeven. |
formatVersion: 1
inputs: {}
resources:
DEMO_ESG : existing security group - security group 1)
type: Cloud.SecurityGroup
properties:
constraints:
- tag: BlockAll
securityGroupType: existing (designation of existing for security group 1)
DEMO_ODSG: (on-demand security group - security group 2))
type: Cloud.SecurityGroup
properties:
rules: (multiple firewall rules in this section)
- name: IN-ANY (rule 1)
source: any
service: any
direction: inbound
access: Deny
- name: IN-SSH (rule 2)
source: any
service: SSH
direction: inbound
access: Allow
- name: IN-SSH-IP (rule 3)
source: 33.33.33.1-33.33.33.250
protocol: TCP
ports: 223
direction: inbound
access: Allow
- name: IPv-6-ANY-SOURCE (rule 4)
source: '::/0'
protocol: TCP
ports: 223
direction: inbound
access: Allow
- name: IN-SSH-IP (rule 5)
source: 44.44.44.1/24
protocol: UDP
ports: 22-25
direction: inbound
access: Allow
- name: IN-EXISTING-SG (rule 6)
source: '${resource["DEMO_ESG"].id}'
protocol: ICMPv6
direction: inbound
access: Allow
- name: OUT-ANY (rule 7)
destination: any
service: any
direction: outbound
access: Deny
- name: OUT-TCP-IPv6 (rule 8)
destination: '2001:0db8:85a3::8a2e:0370:7334/64'
protocol: TCP
ports: 22
direction: outbound
access: Allow
- name: IPv6-ANY-DESTINATION (rule 9)
destination: '::/0'
protocol: UDP
ports: 23
direction: outbound
access: Allow
- name: OUT-UDP-SERVICE (rule 10)
destination: any
service: NTP
direction: outbound
access: Allow
securityGroupType: new (designation of on-demand for security group 2)
DEMO_VC_MACHINE: (machine resource)
type: Cloud.vSphere.Machine
properties:
image: PHOTON
cpuCount: 1
totalMemoryMB: 1024
networks: (Machine network NICs)
- network: '${resource.DEMO_NW.id}'
securityGroups:
- '${resource.DEMO_ODSG.id}'
- '${resource.DEMO_ESG.id}'
DEMO_NETWORK: (network resource)
type: Cloud.vSphere.Network
properties:
networkType: existing
constraints:
- tag: nsx62 |
Load balancers
| Resourcescenario | Voorbeeldontwerpcode voor cloudsjabloon |
|---|---|
| Geef een logboekregistratieniveau, algoritme en grootte op voor de load balancer. |
Een voorbeeld van een NSX-load balancer met het gebruik van het logboekregistratieniveau, het algoritme en de grootte: resources:
Cloud_LoadBalancer_1:
type: Cloud.NSX.LoadBalancer
properties:
name: myapp-lb
network: '${appnet-public.name}'
instances: '${wordpress.id}'
routes:
- protocol: HTTP port: '80'
loggingLevel: CRITICAL
algorithm: LEAST_CONNECTION
type: MEDIUM
|
| Koppel een load balancer aan een benoemde machine of een benoemde machine-NIC. U kunt In het eerste voorbeeld gebruikt de implementatie de In het tweede voorbeeld gebruikt de implementatie de Het derde voorbeeld toont beide instellingen die worden gebruikt in dezelfde |
U kunt de eigenschap
instances gebruiken om een machine-ID of een machinenetwerk-ID te definiëren:
|
Voeg instellingen voor gezondheidscontrole toe aan een load balancer van NSX. Aanvullende opties zijn httpMethod, requestBody en responseBody. |
myapp-lb: type: Cloud.NSX.LoadBalancer properties: name: myapp-lb network: '${appnet-public.name}' instances: '${wordpress.id}' routes: - protocol: HTTP port: '80' algorithm: ROUND_ROBIN instanceProtocol: HTTP instancePort: '80' healthCheckConfiguration: protocol: HTTP port: '80' urlPath: /mywordpresssite/wp-admin/install.php intervalSeconds: 60 timeoutSeconds: 10 unhealthyThreshold: 10 healthyThreshold: 2 connectionLimit: '50' connectionRateLimit: '50' maxConnections: '500' minConnections: '' internetFacing: true{code} |
| Netwerk op aanvraag met een load balancer met 1 arm. |
inputs: {}
resources:
mp-existing:
type: Cloud.Network
properties:
name: mp-existing
networkType: existing
mp-wordpress:
type: Cloud.vSphere.Machine
properties:
name: wordpress
count: 2
flavor: small
image: tiny
customizationSpec: Linux
networks:
- network: '${resource["mp-private"].id}'
mp-private:
type: Cloud.NSX.Network
properties:
name: mp-private
networkType: private
constraints:
- tag: nsxt
mp-wordpress-lb:
type: Cloud.LoadBalancer
properties:
name: wordpress-lb
internetFacing: false
network: '${resource.mp-existing.id}'
instances: '${resource["mp-wordpress"].id}'
routes:
- protocol: HTTP
port: '80'
instanceProtocol: HTTP
instancePort: '80'
healthCheckConfiguration:
protocol: HTTP
port: '80'
urlPath: /index.pl
intervalSeconds: 60
timeoutSeconds: 30
unhealthyThreshold: 5
healthyThreshold: 2
|
| Bestaand netwerk met een load balancer. |
formatVersion: 1
inputs:
count:
type: integer
default: 1
resources:
ubuntu-vm:
type: Cloud.Machine
properties:
name: ubuntu
flavor: small
image: tiny
count: '${input.count}'
networks:
- network: '${resource.Cloud_NSX_Network_1.id}'
Provider_LoadBalancer_1:
type: Cloud.LoadBalancer
properties:
name: OC-LB
routes:
- protocol: HTTP
port: '80'
instanceProtocol: HTTP
instancePort: '80'
healthCheckConfiguration:
protocol: HTTP
port: '80'
urlPath: /index.html
intervalSeconds: 60
timeoutSeconds: 5
unhealthyThreshold: 5
healthyThreshold: 2
network: '${resource.Cloud_NSX_Network_1.id}'
internetFacing: false
instances: '${resource["ubuntu-vm"].id}'
Cloud_NSX_Network_1:
type: Cloud.NSX.Network
properties:
networkType: existing
constraints:
- tag: nsxt24prod |
Meer informatie
- Load Balancer with NSX-T Deep Dive
- Network Automation with NSX – Part 1 (omvat het gebruik van NSX-T- en vCenter-cloudaccounts en netwerk-CIDR)
- Network Automation with NSX – Part 2 (omvat het gebruik van bestaande en uitgaande netwerktypen)
- Network Automation with NSX – Part 3 (omvat het gebruik van bestaande beveiligingsgroepen en beveiligingsgroepen op aanvraag)
- Network Automation with NSX – Part 4 (omvat het gebruik van bestaande load balancers en load balancers op aanvraag)