3998 Commits

Author SHA1 Message Date
Nicolas Vazquez
413d10dd81
server: Extend the Annotations framework (#5103)
* Extend addAnnotation and listAnnotations APIs

* Allow users to add, list and remove comments

* Add adminsonly UI and allow admins or owners to remove comments

* New annotations tab

* In progress: new comments section

* Address review comments

* Fix

* Fix annotationfilter and comments section

* Add keyword and delete action

* Fix and rename annotations tab

* Update annotation visibility API and update comments table accordingly

* Allow users seeing all the comments for their owned resources

* Extend comments for volumes and snapshots

* Extend comments to multiple entities

* Add uuid to ssh keypairs

* SSH keypair UI refactor

* Extend comments to the infrastructure entities

* Add missing entities

* Fix upgrade version for ssh keypairs

* Fix typo on DB upgrade schema

* Fix annotations table columns when there is no data

* Extend the list view of items showing they if they have comments

* Remove extra test

* Add annotation permissions

* Address review comments

* Extend marvin tests for annotations

* updating ui stuff

* addition to toggle visibility

* Fix pagination on comments section

* Extend to kubernetes clusters

* Fixes after last review

* Change default value for adminsonly column

* Remove the required field for the annotationfilter parameter

* Small fixes on visibility and other fixes

* Cleanup to reduce files changed

* Rollback extra line

* Address review comments

* Fix cleanup error on smoke test

* Fix sending incorrect parameter to checkPermissions method

* Add check domain access for the calling account for domain networks

* Fix only display annotations icon if there are comments the user can see

* Simply change the Save button label to Submit

* Change order of the Tools menu to provent users getting 404 error on clicking the text instead of expanding

* Remove comments when removing entities

* Address review comments on marvin tests

* Allow users to list annotations for an entity ID

* Allow users to see all comments for allowed entities

* Fix search filters

* Remove username from search filter

* Add pagination to the annotations tab

* Display username for user comments

* Fix add permissions for domain and resource admins

* Fix for domain admins

* Trivial but important UI fix

* Replace pagination for annotations tab

* Add confirmation for delete comment

* Lint warnings

* Fix reduced list as domain admin

* Fix display remove comment button for non admins

* Improve display remove action button

* Remove unused parameter on groupShow

* Include a clock icon to the all comments filter except for root admin

* Move cleanup SQL to the correct file after rebasing main

Co-authored-by: davidjumani <dj.davidjumani1994@gmail.com>
2021-09-08 10:14:06 +05:30
Rohit Yadav
d1db7f4b7b Merge remote-tracking branch 'origin/4.15' into main
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2021-09-06 18:30:49 +05:30
Abhishek Kumar
f564597e92
api, ui: fix NPE with deployVirtualMachine when null boottype (#5387)
* api: fix NPE with deployVirtualMachine when null boottype

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>

* throw exception for empty bootmode

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>

* fix

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>

* ui: fix boot options

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>

* check

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2021-09-06 18:28:32 +05:30
DK101010
9163013683
Feat/ram reservation (#4662)
* remove hot enable cpu und memory in case of reservation

ram and cpu reservation have not relation to ram and cpu hot add

* add custom ram_reservation and it to vm details

* system vms haven't this property, for this reason add additional check

* Update plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/resource/VmwareResource.java

Co-authored-by: dahn <daan.hoogland@gmail.com>

* replace 0.0 with NumberUtils

* remove default value and remove return MinRam(seems to be not necessary)

* Update plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/guru/VmwareVmImplementer.java

Co-authored-by: davidjumani <dj.davidjumani1994@gmail.com>

* Update plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/resource/VmwareResource.java

Co-authored-by: davidjumani <dj.davidjumani1994@gmail.com>

Co-authored-by: DK101010 <dirk.klahre@itelligence.de>
Co-authored-by: dahn <daan.hoogland@gmail.com>
Co-authored-by: davidjumani <dj.davidjumani1994@gmail.com>
2021-08-24 14:15:52 -03:00
Pearl Dsilva
e1e6ec107c
vmware: Bypass empty string check for username and password (#5337)
* Bypass empty string check for username and password

Co-authored-by: dahn <daan.hoogland@gmail.com>
2021-08-24 12:45:29 +05:30
Daniel Augusto Veronezi Salvador
8a16729fcf
Support vm dynamic scaling with kvm (#4878)
* Create utility to centralize byte convertions

* Add/change toString definitions

* Create Libvirt handler to ScaleVmCommand

* Enable dynamic scalling VM with KVM

* Move config from interface to class and rename it

As every variable declared in interfaces are already final,
this moving will be needed to mock tests in nexts commits

* Configure VM max memory and cpu cores

The values are according to service offering or global configs

* Extract dpdk configuration to a method and test it

* Extract OS desc config to a method and test it

* Extract guest resource def to a method and test it

Improve libvirt def

* Refactor LibvirtVMDef.GuestResourceDef

* Refactor ScaleVmCommand

* Improve VMInstaVO toString()

* Refactor upgradeRunningVirtualMachine method

* Turn int variables into long on utility

* Verify if VM is scalable on KVMGuru

* Rename some KVMGuruTest's methods

* Change vm's xml to work with max memory

* Verify if service offering is dynamic before scale

* Create methods to retrieve data from domain

* Create def to hotplug memory

* Adjust the way command was scaling the VM

* Fix database persistence before executing command

* Send more info to host to improve log

* Fix var name

* Fix missing "}"

* Undo unnecessary changes

* Address review

* Fix scale validation

* Add VM prepared for dynamic scaling validation

* Refactor LibvirtScaleVmCommandWrapper and improve unit tests

* Remove duplicated method

* Add RuntimeException check

* Remove copyright from header

* Remove copyright from header

* Remove copyright from header

* Remove copyright from header

* Remove copyright from header

* Update ByteScaleUtilsTest.java

Co-authored-by: Daniel Augusto Veronezi Salvador <daniel@scclouds.com.br>
2021-08-21 09:29:02 +02:00
Rakesh
ee01522d3f
Allow users to update volume name (#4618)
Provide an api support to update volume name by all users
2021-08-19 11:56:35 -03:00
Rohit Yadav
953f5b81ed Merge remote-tracking branch 'origin/4.15' into main 2021-08-18 16:56:19 +05:30
davidjumani
21d7854274
s2svpn: Set initial state as Connecting (#5327)
* s2svpn: Set initial state as Connecting

* Fix comments

* Adding connecting elsewhere
2021-08-18 16:50:38 +05:30
Rakesh
00e014ca58
Add sent and received bytes to listNetworks and listVirtualMachines. (#4776)
* Add sent and receivedbytes to listNetworks and listVirtualMachines.

Display the traffic data in networks and vm api response

* follow code convention

* remove final keyword

Co-authored-by: Rakesh Venkatesh <rakeshv@apache.org>
2021-08-16 14:29:34 -03:00
DK101010
1d17d7cfbc
Add internal cs name to vm during the ingest (#5242)
* add internal cs name to vm during the ingest

* Update server/src/main/java/org/apache/cloudstack/vm/UnmanagedVMsManagerImpl.java

Co-authored-by: dahn <daan.hoogland@gmail.com>

* remove lang.StringUtils

* Update vmware-base/src/main/java/com/cloud/hypervisor/vmware/mo/HostMO.java

Co-authored-by: sureshanaparti <12028987+sureshanaparti@users.noreply.github.com>

* Update vmware-base/src/main/java/com/cloud/hypervisor/vmware/mo/HostMO.java

Co-authored-by: Abhishek Kumar <abhishek.mrt22@gmail.com>

Co-authored-by: DK101010 <dirk.klahre@itelligence.de>
Co-authored-by: dahn <daan.hoogland@gmail.com>
Co-authored-by: sureshanaparti <12028987+sureshanaparti@users.noreply.github.com>
Co-authored-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2021-08-13 16:38:52 -03:00
Wei Zhou
846efdbfe4
server: Optional destination host when migrate a vm (#4378)
* server: Optional destination host when migrate a vm

* #4378: migrate systemvms/routers with optional host

* #4378: fix mistake

* #4378: fix issue when migrate systemvm

* #4378 add autoselect to migrate api commands

* #4378: more ui change

* #4378: add label label.migrate.auto.select

* #4378: add method chooseVmMigrationDestination

* #4378: fix vm migration wih storageid on vmware

* #4378: add method to collect vm disk/network statistics

* #4378: set autoSelect to default 'true'

* #4378: use BooleanUtils.isNotFalse

Co-authored-by: Wei Zhou <weizhou@apache.org>
2021-08-10 01:25:57 -03:00
davidjumani
3c8c704df3
kubernetes: Deploy kubernetes-provider when creating a cluster (#5254)
* kubernetes: Deploy kubernetes-provider when creating a cluster

Co-authored-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2021-08-09 14:45:20 +05:30
Rakesh
949cf71491
api: Display last updated time for VM (#4685)
Add a field in api response and ui to display last updated time
2021-08-09 14:17:53 +05:30
Rakesh
2f8d557f58
api: Change GET/POST request max length of VM user data to 4K/1M (#4737)
Currently we can send a default value of 4K/32K for GET/POST request of
user data field. Most new browsers and also nginx support till 1MB of
post data.

Added a new global setting `vm.userdata.max.length` with default value of
32KB which can be increased till 1MB.
2021-08-09 14:14:19 +05:30
Gabriel Beims Bräscher
43c8da2d0e
API-call to declare host as Degraded (#4111)
* Declare host as dead

* Enhance DeclareHostAsDeadCmd and add CancelHostAsDeadCmd

* Stop VMs on Dead Host
- Enhance code

* Add "since" on API, enhance description; change API cmds response handling

* Replace the ResourceState and command names from 'Dead' to 'Degraded'

* Replace missing 'Dead' word to 'Degraded'

* Update API version for 4.16.0.0
2021-08-08 21:38:06 +02:00
slavkap
d6a77a72f0
Allow updating the storage/host tags of service offerings (#5043) 2021-08-02 15:48:07 +02:00
Sina Kashipazha
490658c5c3
display nics deviceid and order nics by deviceid on Nics tab of instances. (#4768) 2021-07-28 15:11:43 -03:00
Abhishek Kumar
87ee86679e
ui: vmware vm import-unmanage (#5075)
Adds UI for importing and unmanaging VMs.
A new navigation section - Tools has been added in the UI.

Doc PR: apache/cloudstack-documentation#221

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2021-07-27 11:12:37 +05:30
Daniel Augusto Veronezi Salvador
3c1219a5e2
Add logs to api removeVpnUser (#4616)
Co-authored-by: Daniel Augusto Veronezi Salvador <daniel@scclouds.com.br>
2021-07-26 23:28:06 -03:00
SadiJr
eff2da2518
Refactor and improvements for method com.cloud.hypervisor.kvm.resource.LibvirtComputingResource.createVMFromSpec() (#5149)
* Refactor method createVMFromSpec

* Add unit tests

* Fix test

* Extract if block to method for add extra configs to VM Domain XML

* Split travis tests trying to isolate which test is causing an error

* Override toString() method

* Update documentation

* Fix checkstyle error (line with trailing spaces)

* Change VirtualMachineTO print of object

* Add try except to find message error. Remove after test

* Fix indent

* Trying to understanding why is happening in this code

* Refactor method createVMFromSpec

* Add unit tests

* Fix test

* Extract if block to method for add extra configs to VM Domain XML

* Split travis tests trying to isolate which test is causing an error

* Override toString() method

* Update documentation

* Fix checkstyle error (line with trailing spaces)

* Remove unnecessary comment

* Revert travis tests

Co-authored-by: SadiJr <17a0db2854@firemailbox.club>
2021-07-21 15:07:25 -03:00
Pearl Dsilva
1f743e911a
api: Add 'created' field to API response (#5210)
* api: Add 'created' field to API response

* address comments
2021-07-20 18:04:13 -03:00
Spaceman1984
96c9c5a5e2
Added disk provisioning type support for VMWare (#4640)
* Added disk provisioning type support for VMWare

* Review changes

* Fixed unit test

* Review changes

* Added missing licenses

* Review changes

* Update StoragePoolInfo.java

Removed white space

* Review change - Getting disk provisioning strictness setting using the zone id and not the pool id

* Delete __init__.py

* Merge fix

* Fixed failing test

* Added comment about parameters

* Added error log when update fails

* Added exception when using API

* Ordering storage pool selection to prefer thick disk capable pools if available

* Removed unused parameter

* Reordering changes

* Returning storage pool details after update

* Removed multiple pool update, updated marvin test, removed duplicate enum

* Removed comment

* Removed unused import

* Removed for loop

* Added missing return statements for failed checks

* Class name change

* Null pointer

* Added more info when a deployment fails

* Null pointer

* Update api/src/main/java/org/apache/cloudstack/api/BaseListCmd.java

Co-authored-by: dahn <daan.hoogland@gmail.com>

* Small bug fix on API response and added missing bracket

* Removed datastore cluster code

* Removed unused imports, added missing signature

* Removed duplicate config key

* Revert "Added more info when a deployment fails"

This reverts commit 2486db78dca8e034d8ad2386174dfb11004ce654.

Co-authored-by: dahn <daan.hoogland@gmail.com>
2021-07-16 22:37:42 -03:00
Gregor Riepl
ff07fee286
api: Fix deprecation of CIDR_LIST parameter (#5211)
* Revert deprecation of CIDR_LIST parameter in CreateFireWallRule

* Deprecate CIDR_LIST parameter in CreateLoadBalancerRule

* Deprecate CIDR_LIST parameter in CreateIpForwardingRule
2021-07-16 12:11:40 +05:30
davidjumani
f98d35d4a4
api: Ensure required parameters are not empty (#5136)
* apiserver : Ensure required parameters are not empty

* supported services are not required as they can be empty

* Removing redudndant validators
2021-07-15 12:48:24 +05:30
Gregor Riepl
a8cfb77b2b
Document cidrlist parameter deprecation (#4037)
* Document cidrlist param deprecation in CreatePortForwardingRule and CreateFirewallRule

Co-authored-by: dahn <daan.hoogland@gmail.com>
2021-07-09 22:57:09 +05:30
Rohit Yadav
d916e416ec Updating pom.xml version numbers for release 4.15.2.0-SNAPSHOT
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2021-07-02 22:59:07 +05:30
Wei Zhou
9ac3925936
server: list routers by healthchecksfailed (#4886)
* server: list routers by healthchecksfailed

* #4886: fix build error

* #4886: ignore global setting

Co-authored-by: Wei Zhou <weizhou@apache.org>
2021-06-29 12:52:24 +05:30
Rohit Yadav
379454caae Updating pom.xml version numbers for release 4.15.1.0
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2021-06-28 15:27:27 +05:30
sureshanaparti
4f6851f4c0
Some missed inclusivity changes - use inclusive words/terms as appropriate. (#5131) 2021-06-18 17:10:11 +02:00
Gabriel Beims Bräscher
1c36ea9b4f
Enhance Documentation for changeServiceForVirtualMachine and scaleVirtualMachine (#5101) 2021-06-15 23:25:20 +02:00
Harikrishna
083646b3c3
server: VM dynamic scaling option granularity (#4643)
This PR introduces new granularity levels to configure VM dynamic scalability. Previously VM is configured to be dynamically scalable based on the template and global setting. Now we bringing this option to configure at service offering and VM level also.

VM can dynamically scale only when all flags are ON at VM level, template, service offering and global setting. If any of the flags is set to false then VM cannot be scalable. This result will be persisted in DB for each VM and will be honoured for that VM till it is updated.

We are introducing 'dynamicscalingallowed' parameter with permitted values of true or false for deployVM API and createServiceOffering API.

Following are the API parameter changes:
createServiceOffering API: 
          dynamicscalingenabled: an optional parameter of type Boolean with default value “true”.
deployVirtualMachine API: 
          dynamicscalingenabled: an optional parameter of type Boolean with default value “true”.

Following are the UI changes:
Service offering creation has ON/OFF switch for dynamic scaling enabled with default value true
2021-06-08 17:10:00 +05:30
Suresh Kumar Anaparti
958182481e cloudstack: make code more inclusive
Inclusivity changes for CloudStack

- Change default git branch name from 'master' to 'main' (post renaming/changing default git branch to 'main' in git repo)
- Rename some offensive words/terms as appropriate for inclusiveness.

This PR updates the default git branch to 'main', as part of #4887.

Signed-off-by: Suresh Kumar Anaparti <suresh.anaparti@shapeblue.com>
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2021-06-08 15:47:20 +05:30
Daniel Augusto Veronezi Salvador
06744c16ba
Externalize OOBM background task's interval (#4881)
* Externalize OOBM background task's interval

* Rename variable

Co-authored-by: Daniel Augusto Veronezi Salvador <daniel@scclouds.com.br>
2021-05-25 11:42:53 +02:00
Sina Kashipazha
1e13855612
Add startdate formate to documents. (#5026)
Add startdate formate to documents.
2021-05-25 11:23:53 +02:00
Abhishek Kumar
4b7fa4e630 Merge remote-tracking branch 'apache/4.15'
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2021-05-24 16:43:53 +05:30
Spaceman1984
5cbc1d9b18
Fixed invalid ostypeid when not using deployasis (#5033) 2021-05-21 15:15:24 +05:30
Pearl Dsilva
2eae0f5385
SystemVM: Set agent state to disconnected on Stopping the systemVM (#5010)
Fixes: #4972
This PR sets systevms' agent state to disconnected when it is stopped. Currently, when a systemVM (Console Proxy VM / Secondary storage VM) is stopped, the agent state still appears to be 'Up'
2021-05-19 13:00:17 +05:30
Abhishek Kumar
426f14b6ed Merge remote-tracking branch 'apache/4.15'
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2021-05-18 15:19:20 +05:30
Rohit Yadav
2286c8d2bf Merge remote-tracking branch 'origin/4.14' into 4.15 2021-05-14 23:19:06 +05:30
Abhishek Kumar
dc91a1fd4d
server: destroy ssvm, cpvm on last host maintenance (#4644)
* server: destroy ssvm, cpvm on last host maintenance

When a single or last UP host enters into maintenance just stopping SSVM and CPVM will leave behind VMs on hypervisor side. As these system vms will be recreated they can be destroyed.
Fixes #3719

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>

* fix methods

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>

* immediately destroy systemvms

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>

* fix destroy

Added bypassHostMaintenance flag in Comma.java class to allow command to be handled by host agent even when host is in maintenace.
Flag is set true only for delete commands for ssvm and cpvm.

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>

* unit test fix

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>

* fix missing return statement

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>

* fix

VM should be stopped with cleanup before calling expunge else it server may through error with host in PrepareForMaintenance state.

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>

* refactor

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>

* rename

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>

* refactor

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2021-05-14 23:16:15 +05:30
Abhishek Kumar
755791089d
api/server: cpu, memory values with overprovisioning in metrics response (#4795)
* metrics: operprovisioned host cpu allocated

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>

* changes

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>

* remove unused

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2021-05-14 23:15:35 +05:30
Wei Zhou
e2183ed666
forceha: fix two issues when (1)stop vm from inside (2) force remove host (#4647)
* forceha: fix vm is not started if it is poweroff from inside

steps to reproduce the issue
(1) make sure force.ha is true in global setting. if not, change it to true, and restart mgt server
(2) create a service offering , ha is not enabled
(3) create a vm
(4) log into the vm, and power off via cli.

expected result: vm is started again by cloudstack
actual result: vm is not started.

* forceha: fix vms are still running if host is force-removed

when host can be force removed, however vms are stopped in cloudstack, but not stopped on host
```
(localcloud) 🐱 > delete host id="a5625393-444d-4d0a-b31d-62baf88a8be1" forced=true
{
  "success": true
}```

after some minutes, vms are still runnning on host
```
root@mgt01:~# ssh node63 virsh list
 Id   Name        State
---------------------------
 1    i-2-19-VM   running
 2    i-2-11-VM   running
```

error message are
```
Cannot transmit host 2 to Enabled state
com.cloud.utils.fsm.NoTransitionException: No next resource state found for current state = Enabled event = DeleteHost
        at com.cloud.resource.ResourceManagerImpl.resourceStateTransitTo(ResourceManagerImpl.java:1216)
        at com.cloud.resource.ResourceManagerImpl$1.doInTransactionWithoutResult(ResourceManagerImpl.java:907)
```

* forceha: Make ForceHA dynamic
2021-05-14 23:14:39 +05:30
Nicolas Vazquez
aa289542f0
vmware: Fix deploy-as-is not honoured on upload from local (#5015)
* Fix deploy-as-is not honoured on upload from local

* Missing param
2021-05-13 14:30:34 +05:30
Rohit Yadav
cb167072a1 Merge remote-tracking branch 'origin/4.15'
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2021-05-07 16:37:42 +05:30
Harikrishna
32e3bbdcc5
VMware Datastore Cluster primary storage pool synchronisation (#4871)
Datastore cluster as a primary storage support is already there. But if any changes at vCenter to datastore cluster like addition/removal of datastore is not synchronised with CloudStack directly. It needs removal of primary storage from CloudStack and add it again to CloudStack.

Here synchronisation of datastore cluster is fixed without need to remove or add the datastore cluster.
1. A new API is introduced syncStoragePool which takes datastore cluster storage pool UUID as the parameter. This API checks if there any changes in the datastore cluster and updates management server accordingly.
2. During synchronisation if a new child datastore is found in datastore cluster, then management server will create a new child storage pool in database under the datastore cluster. If the new child storage pool is already added as an individual storage pool then the existing storage pool entry will be converted to child storage pool (instead of creating a new storage pool entry)
3. During synchronisaton if the existing child datastore in CloudStack is found to be removed on vCenter then management server removes that child datastore from datastore cluster and makes it an individual storage pool.
The above behaviour is on par with the vCenter behaviour when adding and removing child datastore.
2021-05-07 16:30:54 +05:30
Rohit Yadav
ee5f92e292 Merge remote-tracking branch 'origin/4.15' 2021-05-06 18:25:04 +05:30
sureshanaparti
645ceecea4
Updated since and validations attributes for the ikeversion and splitconnections parameters of vpn customer gateway cmd(s) (#4996) 2021-05-06 10:38:36 +05:30
Rohit Yadav
fce84e62ab Merge remote-tracking branch 'origin/4.15' 2021-05-06 00:27:43 +05:30
Pearl Dsilva
bc80815cf5
server: Adding VPN options for IKE version and IKE split connections (#4953)
IKE version allows selecting ike (autoselect), ikev1, or ikev2.
Split connections gives an option of separating the first right subnet from the rest, and kicking out individual statements for each right subnet for better cross-compatibility.

Backported from PR: #4137
update per PR suggestion

Fixes #3138

Co-authored-by: Greg Goodrich <ggoodrich@ippathways.com>
Co-authored-by: Daan Hoogland <dahn@onecht.net>
Co-authored-by: Pearl Dsilva <pearl.dsilva@shapeblue.com>
2021-05-05 12:54:23 +05:30