Skip to content

Commit d4dd792

Browse files
authored
Merge pull request #52 from QualiSystems/dev
release 6.0.0
2 parents 166724d + 7ed2049 commit d4dd792

File tree

9 files changed

+69
-15
lines changed

9 files changed

+69
-15
lines changed

.github/workflows/create-github-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
- master
1010
jobs:
1111
shell-ci:
12-
uses: QualiSystems/.github/.github/workflows/shell-py-37-39.yml@master
12+
uses: QualiSystems/.github/.github/workflows/shell-py-39.yml@master
1313
github-release:
1414
needs: shell-ci
1515
uses: QualiSystems/.github/.github/workflows/shell-github-release.yml@master

.github/workflows/shell.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ on:
99
- master
1010
jobs:
1111
shell-ci:
12-
uses: QualiSystems/.github/.github/workflows/shell-py-37-39.yml@master
12+
uses: QualiSystems/.github/.github/workflows/shell-py-39.yml@master

.github/workflows/update-github-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: update release
22
on: workflow_dispatch
33
jobs:
44
shell-ci:
5-
uses: QualiSystems/.github/.github/workflows/shell-py-37-39.yml@master
5+
uses: QualiSystems/.github/.github/workflows/shell-py-39.yml@master
66
github-release:
77
needs: shell-ci
88
uses: QualiSystems/.github/.github/workflows/shell-github-release.yml@master

.pre-commit-config.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
repos:
22
- repo: https://github.com/asottile/pyupgrade
3-
rev: v2.32.0
3+
rev: v3.3.1
44
hooks:
55
- id: pyupgrade
66
args:
7-
- "--py37-plus"
7+
- "--py39-plus"
88
- repo: https://github.com/timothycrosley/isort
9-
rev: 5.10.1
9+
rev: 5.12.0
1010
hooks:
1111
- id: isort
1212
- repo: https://github.com/python/black
13-
rev: 22.3.0
13+
rev: 22.12.0
1414
hooks:
1515
- id: black
1616
- repo: https://github.com/pycqa/flake8
17-
rev: 4.0.1
17+
rev: 5.0.4
1818
hooks:
1919
- id: flake8
2020
additional_dependencies: [

deployments/deployment-path.yaml

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ node_types:
2020
type: string
2121
description: "vCenter VM to use in the VM creation. Should include the full path
2222
and the vm name, for example QualiFolder/VM121"
23-
tags: [user_input, editable_only_in_app_template]
23+
tags: [user_input, editable_only_in_app_template, enable_hints]
2424
VM Cluster:
2525
type: string
2626
description: "The vCenter cluster or host that will be used when deploying a VM.
@@ -124,6 +124,11 @@ node_types:
124124
would be the same as App name."
125125
default: true
126126
tags: []
127+
Copy source UUID:
128+
type: boolean
129+
description: "If true the BIOS UUID of the source VM will be copied to the new VM."
130+
default: false
131+
tags: [user_input]
127132
artifacts:
128133
icon:
129134
file: shell-icon.png
@@ -136,7 +141,7 @@ node_types:
136141
type: string
137142
description: "vCenter VM template to use in the VM creation. Should include the full path and
138143
the template name, for example QualiFolder/Template1"
139-
tags: [user_input, editable_only_in_app_template]
144+
tags: [user_input, editable_only_in_app_template, enable_hints]
140145
VM Cluster:
141146
type: string
142147
description: "The vCenter cluster or host that will be used when deploying a VM.
@@ -240,6 +245,11 @@ node_types:
240245
would be the same as App name."
241246
default: true
242247
tags: []
248+
Copy source UUID:
249+
type: boolean
250+
description: "If true the BIOS UUID of the source VM will be copied to the new VM."
251+
default: false
252+
tags: [ user_input ]
243253
artifacts:
244254
icon:
245255
file: shell-icon.png
@@ -252,13 +262,13 @@ node_types:
252262
type: string
253263
description: "vCenter VM to use in the VM creation. Should include the full path
254264
and the vm name, for example QualiFolder/VM121"
255-
tags: [user_input, editable_only_in_app_template]
265+
tags: [user_input, editable_only_in_app_template, enable_hints]
256266
vCenter VM Snapshot:
257267
type: string
258268
description: "The snapshot that will be used to clone a new VM. This snapshot should be associated
259269
with the VM defined in the vCenter VM input. Should include the full path of the snapshot,
260270
for example Snapshot1/Snapshot2"
261-
tags: [user_input, editable_only_in_app_template]
271+
tags: [user_input, editable_only_in_app_template, enable_hints]
262272
VM Cluster:
263273
type: string
264274
description: "The vCenter cluster or host that will be used when deploying a VM.
@@ -362,6 +372,11 @@ node_types:
362372
would be the same as App name."
363373
default: true
364374
tags: []
375+
Copy source UUID:
376+
type: boolean
377+
description: "If true the BIOS UUID of the source VM will be copied to the new VM."
378+
default: false
379+
tags: [ user_input ]
365380
artifacts:
366381
icon:
367382
file: shell-icon.png

shell-definition.yaml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ tosca_definitions_version: tosca_simple_yaml_1_0
33
metadata:
44
template_name: VMware vCenter Cloud Provider Shell 2G
55
template_author: Quali
6-
template_version: 4.2.5
6+
template_version: 6.0.0
77
template_icon: shell-icon.png
88

99
description: >
@@ -70,6 +70,12 @@ node_types:
7070
Promiscuous Mode:
7171
type: boolean
7272
default: true
73+
Forged Transmits:
74+
type: boolean
75+
default: true
76+
MAC Address Changes:
77+
type: boolean
78+
default: false
7379
Enable Tags:
7480
type: boolean
7581
default: true
@@ -121,7 +127,16 @@ node_types:
121127
description: "Reserved networks separated by Semicolon(;), vNICs configured to those networks won't be used for VM connectivity."
122128
Promiscuous Mode:
123129
type: boolean
124-
description: "If enabled the port groups on the virtual switch will be configured to allow promiscuous mode."
130+
description: "If enabled the port groups on the virtual switch will be
131+
configured to allow promiscuous mode."
132+
Forged Transmits:
133+
type: boolean
134+
description: "If enabled the port groups on the virtual switch will be
135+
configured to allow forged transmits."
136+
MAC Address Changes:
137+
type: boolean
138+
description: "If enabled the port groups on the virtual switch will be
139+
configured to allow MAC address changes."
125140
Enable Tags:
126141
type: boolean
127142
default: true

src/driver.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
refresh_ip,
3030
validate_attributes,
3131
)
32+
from cloudshell.cp.vcenter.flows.affinity_rules_flow import AffinityRulesFlow
3233
from cloudshell.cp.vcenter.flows.connectivity_flow import VCenterConnectivityFlow
3334
from cloudshell.cp.vcenter.flows.customize_guest_os import customize_guest_os
3435
from cloudshell.cp.vcenter.flows.save_restore_app import SaveRestoreAppFlow
@@ -508,3 +509,20 @@ def customize_guest_os(
508509
override_custom_spec,
509510
logger,
510511
)
512+
513+
def add_vm_to_affinity_rule(
514+
self,
515+
context: ResourceCommandContext,
516+
vm_uuids: str,
517+
affinity_rule_name: str | None,
518+
) -> str:
519+
with LoggingSessionContext(context) as logger:
520+
logger.info("Starting Add VMs to Affinity Rule command")
521+
api = CloudShellSessionContext(context).get_api()
522+
resource_config = VCenterResourceConfig.from_context(context, api=api)
523+
reservation_info = ReservationInfo.from_resource_context(context)
524+
flow = AffinityRulesFlow(
525+
resource_config, reservation_info.reservation_id, logger
526+
)
527+
vm_uuids = [path.strip() for path in vm_uuids.split(";")]
528+
return flow.add_vms_to_affinity_rule(vm_uuids, affinity_rule_name)

src/drivermetadata.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@
5555
<Parameter Description="Override any prepared customization spec for the VM" DisplayName="Override Customization Spec" Name="override_custom_spec" Type="Lookup" AllowedValues="True,False" DefaultValue="False" />
5656
</Parameters>
5757
</Command>
58+
<Command Description="" DisplayName="Add VMs to an affinity rule" Name="add_vm_to_affinity_rule" Tags="allow_unreserved">
59+
<Parameters>
60+
<Parameter Description="UUIDs of the VMs separated by ';' to add to the affinity rule" DisplayName="VM UUIDs" Name="vm_uuids" Type="String" />
61+
<Parameter Description="Name of the existing affinity rule" DisplayName="Affinity Rule Name" Name="affinity_rule_name" Type="String" Mandatory="False" />
62+
</Parameters>
63+
</Command>
5864
</Category>
5965
<Category Name="Power">
6066
<Command Description="" DisplayName="Power On" Name="PowerOn" Tags="power" />

src/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
cloudshell-shell-core~=5.0
22
cloudshell-cp-core~=2.4
3-
cloudshell-cp-vcenter>=4.2.5,<5.0
3+
cloudshell-cp-vcenter~=5.0

0 commit comments

Comments
 (0)