Design file

After you run a Maloja survey, you’ll find a representation of your virtual infrastructure in your output directory (typically named .maloja).

These files keep all the attributes of your Organisations, Templates, Vms etc in YAML format.

You can paste the contents of these files together to describe to Maloja what infrastructure you want it to build. Save it as your design file.

In order to build a new VApp, a design file contains:

  • One Vdc
  • One or more Networks
  • A Template for the VApp
  • Optionally, one or more Vms to add into the VApp
  • Optionally, a configuration for a Gateway

You need to present these items as a YAML list, which means that each is indented once and preceded by a ‘-‘ character.

Example

%YAML 1.2
---

# Paste in the exact contents of a vdc.yaml file.
# Indent once and change the first whitespace character on the first line to '-'.
-   !!omap
    - name: Skyscape Python Development (IL2-PROD-STANDARD)
    - href: https://api.vcd.portal.skyscapecloud.com/api/vdc/8bdd2156-f276-4718-8ea2-21560d89b8e1
    - type: application/vnd.vmware.vcloud.vdc+xml
    - description: Skyscape Python Development (IL2-PROD-STANDARD)

# Paste in the exact contents of a network.yaml file.
# This will be the external network to the VApp.
# Indent once and change the first whitespace character on the first line to '-'.
-   !!omap
    - name: USER_NET
    - href: https://api.vcd.portal.skyscapecloud.com/api/admin/network/9191a38b-e244-40b2-a3bb-46079fa46bab
    - type: application/vnd.vmware.vcloud.orgVdcNetwork+xml
    - defaultGateway: 10.124.24.1
    - netmask: 255.255.255.192

# Paste in the exact contents of a network.yaml file.
# Indent once and change the first whitespace character on the first line to '-'.
# Change the variables as necessary for dns, etc.
# Remove the 'href' value. This is to be a new network, not a change to an existing one.
-   !!omap
    - name: Demo Network
    - href:
    - type: application/vnd.vmware.vcloud.orgVdcNetwork+xml
    - defaultGateway: 192.168.0.1
    - netmask: 255.255.0.0
    - dhcp:
    - dnsSuffix:
    - dns:
      - 8.8.8.8

# Paste in the exact contents of a template.yaml file.
# Indent once and change the first whitespace character on the first line to '-'.
# Change the name if necessary.
-   !!omap
    - name: Demo Website
    - href: https://api.vcd.portal.skyscapecloud.com/api/vAppTemplate/vappTemplate-207117c3-ee0f-4301-ae3f-0e026481a363
    - type: application/vnd.vmware.vcloud.vAppTemplate+xml
    - dateCreated: '2013-07-17T10:38:56.457+01:00'

# Paste in the exact contents of a catalog vm.yaml file:
# Indent once and change the first whitespace character on the first line to '-':
# Change the variables as necessary for hard disk capacity, etc and remove the rest.
-   !!omap
    - name: Web
    - href: https://api.vcd.portal.skyscapecloud.com/api/vAppTemplate/vm-e5b91cc2-e85f-4922-8ee2-46e9d8b9f935
    - type: application/vnd.vmware.vcloud.vm+xml
    - guestOs: CentOS 4/5/6/7 (64-bit)
    - hardwareVersion: []
    - cpu: 1
    - memoryMB: 2048
    - networkcards:
      - !!omap
        - name: Network adapter 0
        - mac:
        - device: E1000
    - scsi:
      - !!omap
        - name:
        - device: lsilogic
    - harddisks:
      - !!omap
        - name: Hard disk
        - capacity: 51200
    - cd:
    - networkconnections:
      - !!omap
        - name: Demo Network
        - ip: 192.168.1.5
        - isConnected: true
        - macAddress:
        - ipAddressAllocationMode: MANUAL
    - guestcustomization:

# Paste in the exact contents of a catalog vm.yaml file.
# Indent once and change the first whitespace character on the first line to '-'.
# Change the variables as necessary for hard disk capacity, etc and remove the rest.
-   !!omap
    - name: App
    - href: https://api.vcd.portal.skyscapecloud.com/api/vAppTemplate/vm-e5b91cc2-e85f-4922-8ee2-46e9d8b9f935
    - type: application/vnd.vmware.vcloud.vm+xml
    - guestOs: CentOS 4/5/6/7 (64-bit)
    - cpu: 1
    - memoryMB: 2048
    - networkcards:
      - !!omap
        - name: Network adapter 0
        - mac:
        - device: E1000
    - scsi:
      - !!omap
        - name:
        - device: lsilogic
    - harddisks:
      - !!omap
        - name: Hard disk
        - capacity: 51200
    - cd:
    - networkconnections:
      - !!omap
        - name: Demo Network
        - ip: 192.168.1.6
        - isConnected: true
        - macAddress:
        - ipAddressAllocationMode: MANUAL
    - guestcustomization:

# Paste in the exact contents of a catalog vm.yaml file.
# Indent once and change the first whitespace character on the first line to '-'.
# Change the variables as necessary for hard disk capacity, etc and remove the rest.
-   !!omap
    - name: DB
    - href: https://api.vcd.portal.skyscapecloud.com/api/vAppTemplate/vm-e5b91cc2-e85f-4922-8ee2-46e9d8b9f935
    - type: application/vnd.vmware.vcloud.vm+xml
    - guestOs: CentOS 4/5/6/7 (64-bit)
    - cpu: 1
    - memoryMB: 2048
    - networkcards:
      - !!omap
        - name: Network adapter 0
        - mac:
        - device: E1000
    - scsi:
      - !!omap
        - name:
        - device: lsilogic
    - harddisks:
      - !!omap
        - name: Hard disk
        - capacity: 51200
    - cd:
    - networkconnections:
      - !!omap
        - name: Demo Network
        - ip: 192.168.1.7
        - isConnected: true
        - macAddress:
        - ipAddressAllocationMode: MANUAL
    - guestcustomization:

# Paste in the exact contents of an edge.yaml file:
# Indent once and change the first whitespace character on the first line to '-':
# Change the variables as necessary for NATting, Firewall, etc
-   !!omap
    - name: nft002bfi2
    - href: https://api.vcd.portal.skyscapecloud.com/api/admin/edgeGateway/4547daf2-6370-483a-877b-b16e0f33ba56
    - type: application/vnd.vmware.admin.edgeGateway+xml
    - fw:
      - !!omap
        - description: Web service
        - int_addr:
          - 51.179.194.122
          - 51.179.194.123
        - int_port: 80
        - ext_addr:
        - ext_port:
    - dnat:
      - !!omap
        - int_addr:
          - 192.168.1.5
        - int_port: 80
        - ext_addr:
          - 51.179.194.122
        - ext_port: 80
    - snat:
      - !!omap
        - int_addr:
          - 192.168.1.5
        - int_port:
        - ext_addr:
          - 51.179.194.122
        - ext_port:

Plan command

You can check your design file with Maloja’s plan command:

maloja @options.private plan --input=my_design.yaml

The output will verify the objects in the file:

2016-02-18 10:02:00,626 INFO    maloja|Using project proj_f9rb9m99.
2016-02-18 10:02:00,676 INFO    maloja.planner|Vdc 'Skyscape Python Development (IL2-PROD-STANDARD)' is parent Vdc.
2016-02-18 10:02:00,676 INFO    maloja.planner|Network 'USER_NET' is public network.
2016-02-18 10:02:00,686 INFO    maloja.planner|Network 'Demo Network'  is private network.
2016-02-18 10:02:00,686 INFO    maloja.planner|Template 'Demo Website' provides VApp template.
2016-02-18 10:02:00,686 INFO    maloja.planner|Vm 'Web' to be created.
2016-02-18 10:02:00,696 INFO    maloja.planner|Vm 'App' to be created.
2016-02-18 10:02:00,696 INFO    maloja.planner|Vm 'DB' to be created.
2016-02-18 10:02:00,696 INFO    maloja.planner|Gateway 'nft002bfi2' to modify rules.
2016-02-18 10:02:00,706 INFO    maloja.planner|Approved 8 objects of 8
2016-02-18 10:02:00,706 INFO    maloja.planner|OK.

Build command

Once you’re happy with the details of your design file, you can apply the build command to get it made:

maloja @options.private build --input=my_design.yaml

Inspect command

Use the inspect command to check the results of a build. Pass in the design file you used and the name of an entity to check:

maloja @options.private inspect --input=my_design.yaml --name=my_asset_name

In this example, we passed in the name of a VApp we created. The non-complying items are marked with WARNINGS:

2016-02-18 10:10:04,349 INFO    maloja|Using project proj_f9rb9m99.
Enter your API password:
2016-02-18 10:10:13,159 INFO    maloja.planner|Vdc 'Skyscape Python Development (IL2-PROD-STANDARD)' is parent Vdc.
2016-02-18 10:10:13,159 INFO    maloja.planner|Network 'USER_NET' is public network.
2016-02-18 10:10:13,159 INFO    maloja.planner|Network 'Demo Network'  is private network.
2016-02-18 10:10:13,159 INFO    maloja.planner|Template 'Demo Website' provides VApp template.
2016-02-18 10:10:13,169 INFO    maloja.planner|Vm 'Web' to be created.
2016-02-18 10:10:13,169 INFO    maloja.planner|Vm 'App' to be created.
2016-02-18 10:10:13,169 INFO    maloja.planner|Vm 'DB' to be created.
2016-02-18 10:10:13,179 INFO    maloja.planner|Gateway 'nft002bfi2' to modify rules.
2016-02-18 10:10:13,179 INFO    maloja.planner|Approved 8 objects of 8
2016-02-18 10:10:20,259 INFO    maloja.inspector.check_orgvdcnetwork|Network 'USER_NET' OK.
2016-02-18 10:10:20,659 WARNING maloja.inspector.check_vapp|Found name: 'Skyscape_CentOS_6_4_x64_50GB_Tiny_v1.0.1', expected 'Demo Website'.
2016-02-18 10:10:22,589 WARNING maloja.inspector.check_vms|VApp contains extra VMs.
2016-02-18 10:10:24,049 WARNING maloja.inspector.check_vms|Found name: 'b064e3070ffd4e719be6560365b1bd79', expected 'App'.
2016-02-18 10:10:25,989 WARNING maloja.inspector.check_vms|Found name: '2c92974018344be680aefe218c721049', expected 'DB'.
2016-02-18 10:10:28,429 WARNING maloja.inspector.check_vms|Found name: 'Skyscape_CentOS_6_4_x64_50GB_Tiny_v1.0.1', expected 'DB'.
2016-02-18 10:10:30,789 WARNING maloja.inspector.check_vms|Found name: '8f5184e531824b0883d9300c1e23918f', expected 'Web'.
2016-02-18 10:10:32,819 INFO    maloja.inspector.check_gateway|Gateway 'nft002bfi2' OK.