Skip to content

Commit

Permalink
CZ-101 Change the address_server to string and update blueprint (#10)
Browse files Browse the repository at this point in the history
* CZ-101 Change the address_server to string and update blueprint

* CZ-100 Retry instead of raise failure for fetching vm ports
  • Loading branch information
mabuaisha authored Aug 29, 2020
1 parent 26965dd commit 9e6b5f2
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 13 deletions.
11 changes: 9 additions & 2 deletions examples/blueprint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,13 @@ inputs:
type: string
default: Cluster

ip_address:
wait_ip:
type: boolean
default: true

ip_v4_address:
type: string
default: '192.168.11.95'

dsl_definitions:

Expand Down Expand Up @@ -103,6 +108,7 @@ node_templates:
agent_config:
install_method: none
allowed_clusters: { get_input: allowed_clusters }
wait_ip: { get_input: wait_ip }
server:
name: { get_input: server_name }
template: { get_input: template }
Expand All @@ -121,7 +127,8 @@ node_templates:
preconfigure:
inputs:
network_unique_id: { get_attribute: [ segment, unique_id ] }
ip_v4_address: { get_input: ip_address }
ip_v4_address: { get_input: ip_v4_address }


virtual_machine_inventory:
type: cloudify.nodes.nsx-t.inventory.VirtualMachine
Expand Down
15 changes: 8 additions & 7 deletions nsx_t_plugin/virtual_machine/virtual_machine.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,9 @@ def _populate_networks_for_virtual_machine(
ports = _lookup_segment_ports(client_config, network_id)
if not ports:
raise OperationRetry(
'Network {0} is still not connected to any device'.format(
network_id))
'Network {0} is not connected to any virtual machine'.format(
network_id)
)
else:
networks_obj = {}
networks_obj['networks'] = {}
Expand All @@ -88,14 +89,14 @@ def _populate_networks_for_virtual_machine(
networks_obj['networks'][network['display_name']] = network

if not target_network:
raise NonRecoverableError(
'The selected network {0} is not '
raise OperationRetry(
'The selected network {0} still not '
'attached to target virtual machine {1}'
''.format(network_id, owner_vm_id)
)

ctx.instance.runtime_properties[network_id] = target_network
ctx.instance.runtime_properties['networks'] = networks_obj
else:
ctx.instance.runtime_properties[network_id] = target_network
ctx.instance.runtime_properties['networks'] = networks_obj


@with_nsx_t_client(VirtualMachine)
Expand Down
6 changes: 3 additions & 3 deletions plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
plugins:
nsx-t:
package_name: cloudify-nsx-t-plugin
source: https://github.com/Cloudify-PS/cloudify-nsx-t-plugin/archive/0.3.1.zip
package_version: '0.3.1'
source: https://github.com/Cloudify-PS/cloudify-nsx-t-plugin/archive/0.3.2.zip
package_version: '0.3.2'
executor: central_deployment_agent

dsl_definitions:
Expand Down Expand Up @@ -102,7 +102,7 @@ data_types:
DHCP lease time in seconds. When specified, this property overwrites
lease time configured DHCP server config.
server_address:
type: list
type: string
required: false
description: >
IP address of the DHCP server in CIDR format.
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

setup(
name='cloudify-nsx-t-plugin',
version='0.3.1',
version='0.3.2',
author='Cloudify Platform Ltd.',
author_email='[email protected]',
license='LICENSE',
Expand Down

0 comments on commit 9e6b5f2

Please sign in to comment.