Skip to content

Conversation

@ustcweizhou
Copy link
Contributor

@ustcweizhou ustcweizhou commented Sep 3, 2020

Description

When use Ubuntu 20.04 as hypervisor, and create an advanced zone with security groups, the systemvms (ssvm and cpvm) are started but the cloud service is not be Up.

in /var/log/cloud.log, it says vm is unable to connect to management server on port 8250.

Later I found there is caused by a iptables rule below

-A BF-cloudbr0 -m physdev --physdev-out ens3: --physdev-is-bridged -j ACCEPT

The physical device should be "ens3" and "ens3:", which comes from

root@node62:~# bridge -o link show | awk '/master cloudbr0 / && !/^[0-9]+: vnet/ {print $2}' | head -1
ens3:

There is no issue with ubuntu 16.04

root@node12:~# bridge -o link show | awk '/master cloudbr0 / && !/^[0-9]+: vnet/ {print $2}' | head -1
eth0

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)

Screenshots (if appropriate):

How Has This Been Tested?

2020-04-27 09:43:54,172 DEBUG [kvm.resource.LibvirtComputingResource] (Agent-Handler-2:null) (logid:c33ba330) /usr/share/cloudstack-common/scripts/vm/network/security_group.py:513: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if rules is None or rules is "":
/usr/share/cloudstack-common/scripts/vm/network/security_group.py:522: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if rules is None or rules is "":
/usr/share/cloudstack-common/scripts/vm/network/security_group.py:823: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if brName is None or brName is "":
in Ubuntu 16.04:

root@node13:~# bridge -o link show
2: eth0 state UP : <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master cloudbr0 state forwarding priority 32 cost 100
5: vnet0 state UNKNOWN : <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master cloud0 state forwarding priority 32 cost 100
6: vnet1 state UNKNOWN : <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master cloudbr0 state forwarding priority 32 cost 100
7: vnet2 state UNKNOWN : <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master cloudbr0 state forwarding priority 32 cost 100

root@node13:~# bridge -o link show | awk '/master cloudbr0 / && !/^[0-9]+: vnet/ {print $2}' | head -1
eth0

root@node13:~# bridge -o link show | awk '/master cloudbr0 / && !/^[0-9]+: vnet/ {print $2}' | head -1 |cut -d ":" -f1
eth0

in Ubuntu 20.04:

root@node62:~# bridge -o link show
2: ens3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master cloudbr0 state forwarding priority 32 cost 100
10: vnet3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master cloud0 state forwarding priority 32 cost 100
11: vnet4: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master cloudbr0 state forwarding priority 32 cost 100
12: vnet5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master cloudbr0 state forwarding priority 32 cost 100

root@node62:~# bridge -o link show | awk '/master cloudbr0 / && !/^[0-9]+: vnet/ {print $2}' | head -1
ens3:

root@node62:~# bridge -o link show | awk '/master cloudbr0 / && !/^[0-9]+: vnet/ {print $2}' | head -1 |cut -d ':' -f1
ens3
except:
rules = None
if rules is None or rules is "":
if rules is None or rules == "":
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe better to change this to:

if not rules:

That captures the None and empty string case right away.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good, thanks @wido


def get_bridge_physdev(brname):
physdev = execute("bridge -o link show | awk '/master %s / && !/^[0-9]+: vnet/ {print $2}' | head -1" % brname)
physdev = execute("bridge -o link show | awk '/master %s / && !/^[0-9]+: vnet/ {print $2}' | head -1 | cut -d ':' -f1" % brname)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we know what changed in Ubuntu 20.04? As the '-o' flag should make it stable to use on the CLI

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wido here is an example
in ubuntu 16.04

root@node42:~# bridge -o link show
2: eth0 state UP : <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master cloudbr0 state forwarding priority 32 cost 100

in ubuntu 20.04

root@node62:~# bridge -o link show
2: ens3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master cloudbr0 state forwarding priority 32 cost 100

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we use ip (iproute2) instead of old tools?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bridge is a part of iproute2. The old tool is called 'brctl'

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is the trick to use ls /sys/class/net to get the exact interface names

@wido
Copy link
Contributor

wido commented Sep 4, 2020

LGTM

@rohityadavcloud
Copy link
Member

@blueorangutan package

@blueorangutan
Copy link

@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

1 similar comment
@blueorangutan
Copy link

@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result: ✖centos7 ✖centos8 ✖debian. JID-1901

@blueorangutan
Copy link

Packaging result: ✖centos7 ✖centos8 ✖debian. JID-1904

@rohityadavcloud
Copy link
Member

@blueorangutan package

@blueorangutan
Copy link

@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result: ✔centos7 ✔centos8 ✔debian. JID-1907

@rohityadavcloud
Copy link
Member

@blueorangutan test

@blueorangutan
Copy link

@rhtyd a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@rohityadavcloud
Copy link
Member

cc @davidjumani can you review?

@blueorangutan
Copy link

Trillian test result (tid-2700)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 99396 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr4303-t2700-kvm-centos7.zip
Intermittent failure detected: /marvin/tests/smoke/test_deploy_virtio_scsi_vm.py
Intermittent failure detected: /marvin/tests/smoke/test_diagnostics.py
Intermittent failure detected: /marvin/tests/smoke/test_internal_lb.py
Intermittent failure detected: /marvin/tests/smoke/test_kubernetes_supported_versions.py
Intermittent failure detected: /marvin/tests/smoke/test_password_server.py
Intermittent failure detected: /marvin/tests/smoke/test_primary_storage.py
Intermittent failure detected: /marvin/tests/smoke/test_privategw_acl.py
Intermittent failure detected: /marvin/tests/smoke/test_routers_network_ops.py
Intermittent failure detected: /marvin/tests/smoke/test_secondary_storage.py
Intermittent failure detected: /marvin/tests/smoke/test_service_offerings.py
Intermittent failure detected: /marvin/tests/smoke/test_templates.py
Intermittent failure detected: /marvin/tests/smoke/test_vm_deployment_planner.py
Intermittent failure detected: /marvin/tests/smoke/test_vm_life_cycle.py
Intermittent failure detected: /marvin/tests/smoke/test_vpc_redundant.py
Intermittent failure detected: /marvin/tests/smoke/test_vpc_vpn.py
Intermittent failure detected: /marvin/tests/smoke/test_hostha_kvm.py
Smoke tests completed. 72 look OK, 13 have error(s)
Only failed tests results shown below:

Test Result Time (s) Test File
test_01_internallb_roundrobin_1VPC_3VM_HTTP_port80 Failure 438.18 test_internal_lb.py
test_02_internallb_roundrobin_1RVPC_3VM_HTTP_port80 Failure 678.24 test_internal_lb.py
test_04_rvpc_internallb_haproxy_stats_on_all_interfaces Error 363.77 test_internal_lb.py
test_01_add_delete_kubernetes_supported_version Error 1807.43 test_kubernetes_supported_versions.py
test_isolate_network_password_server Failure 176.21 test_password_server.py
test_01_add_primary_storage_disabled_host Error 36.91 test_primary_storage.py
test_02_vpc_privategw_static_routes Failure 540.15 test_privategw_acl.py
test_03_vpc_privategw_restart_vpc_cleanup Failure 523.67 test_privategw_acl.py
test_04_rvpc_privategw_static_routes Failure 829.16 test_privategw_acl.py
test_02_isolate_network_FW_PF_default_routes_egress_false Failure 288.19 test_routers_network_ops.py
test_01_sys_vm_start Failure 0.07 test_secondary_storage.py
ContextSuite context=TestCpuCapServiceOfferings>:setup Error 0.00 test_service_offerings.py
test_01_deploy_vm_on_specific_host Error 88.29 test_vm_deployment_planner.py
test_04_deploy_vm_on_host_override_pod_and_cluster Error 8.42 test_vm_deployment_planner.py
test_11_migrate_vm Error 9.41 test_vm_life_cycle.py
test_03_create_redundant_VPC_1tier_2VMs_2IPs_2PF_ACL_reboot_routers Error 760.54 test_vpc_redundant.py
test_04_rvpc_network_garbage_collector_nics Error 4039.34 test_vpc_redundant.py
test_05_rvpc_multi_tiers Failure 1130.73 test_vpc_redundant.py
test_05_rvpc_multi_tiers Error 1168.39 test_vpc_redundant.py
test_01_redundant_vpc_site2site_vpn Failure 3691.45 test_vpc_vpn.py
ContextSuite context=TestRVPCSite2SiteVpn>:teardown Error 4262.22 test_vpc_vpn.py
test_hostha_enable_ha_when_host_in_maintenance Error 302.65 test_hostha_kvm.py

@davidjumani
Copy link
Contributor

Changes LGTM. Will test!

@davidjumani
Copy link
Contributor

Systemvm is still unable to come up on u20, but i think that it might be unrelated

2020-09-16 05:00:45,295 INFO  [kvm.storage.LibvirtStorageAdaptor] (agentRequest-Handler-5:null) (logid:287cef54) Trying to fetch storage pool 0e678d73-abb2-3295-b6c3-b6949a8a2f8d from libvirt
2020-09-16 05:00:48,388 INFO  [kvm.resource.LibvirtConnection] (agentRequest-Handler-1:null) (logid:287cef54) No existing libvirtd connection found. Opening a new one
2020-09-16 05:00:48,389 WARN  [kvm.resource.LibvirtConnection] (agentRequest-Handler-1:null) (logid:287cef54) Can not find a connection for Instance s-61-VM. Assuming the default connection.
2020-09-16 05:00:48,461 WARN  [kvm.resource.LibvirtKvmAgentHook] (agentRequest-Handler-1:null) (logid:287cef54) Groovy script '/etc/cloudstack/agent/hooks/libvirt-vm-state-change.groovy' is not available. Transformations will not be applied.
2020-09-16 05:00:48,461 WARN  [kvm.resource.LibvirtKvmAgentHook] (agentRequest-Handler-1:null) (logid:287cef54) Groovy scripting engine is not initialized. Data transformation skipped.
2020-09-16 05:01:18,900 INFO  [kvm.storage.LibvirtStorageAdaptor] (agentRequest-Handler-2:null) (logid:3d0925b0) Trying to fetch storage pool 0e678d73-abb2-3295-b6c3-b6949a8a2f8d from libvirt
2020-09-16 05:01:18,955 INFO  [kvm.storage.LibvirtStorageAdaptor] (agentRequest-Handler-2:null) (logid:3d0925b0) Attempting to remove volume a2fcc05f-2abd-44a5-a3cf-2474232dac1f from pool 0e678d73-abb2-3295-b6c3-b6949a8a2f8d
2020-09-16 05:01:43,249 INFO  [kvm.storage.LibvirtStorageAdaptor] (agentRequest-Handler-4:null) (logid:287cef54) Trying to fetch storage pool fb4bb1df-cb02-3dfe-9a79-d37ee241d200 from libvirt
2020-09-16 05:01:43,252 INFO  [kvm.storage.LibvirtStorageAdaptor] (agentRequest-Handler-4:null) (logid:287cef54) Trying to fetch storage pool fb4bb1df-cb02-3dfe-9a79-d37ee241d200 from libvirt
2020-09-16 05:01:43,264 INFO  [kvm.storage.LibvirtStorageAdaptor] (agentRequest-Handler-4:null) (logid:287cef54) Creating volume 96de7039-b33f-4dc3-9381-dc62f19dc4f2 from template 01e1c91c-f125-42b7-8e95-3d5145c0d0b3 in pool fb4bb1df-cb02-3dfe-9a79-d37ee241d200 (NetworkFilesystem) with size (0 bytes) 0
2020-09-16 05:01:43,265 INFO  [kvm.storage.LibvirtStorageAdaptor] (agentRequest-Handler-4:null) (logid:287cef54) Attempting to create volume 96de7039-b33f-4dc3-9381-dc62f19dc4f2 (NetworkFilesystem) in pool fb4bb1df-cb02-3dfe-9a79-d37ee241d200 with size (2.44 GB) 2621440000
2020-09-16 05:01:43,778 INFO  [kvm.storage.LibvirtStorageAdaptor] (agentRequest-Handler-5:null) (logid:287cef54) Trying to fetch storage pool fb4bb1df-cb02-3dfe-9a79-d37ee241d200 from libvirt
2020-09-16 05:01:43,814 INFO  [kvm.storage.LibvirtStorageAdaptor] (agentRequest-Handler-5:null) (logid:287cef54) Trying to fetch storage pool fb4bb1df-cb02-3dfe-9a79-d37ee241d200 from libvirt
2020-09-16 05:01:43,859 WARN  [kvm.resource.LibvirtKvmAgentHook] (agentRequest-Handler-5:null) (logid:287cef54) Groovy script '/etc/cloudstack/agent/hooks/libvirt-vm-xml-transformer.groovy' is not available. Transformations will not be applied.
2020-09-16 05:01:43,859 WARN  [kvm.resource.LibvirtKvmAgentHook] (agentRequest-Handler-5:null) (logid:287cef54) Groovy scripting engine is not initialized. Data transformation skipped.
2020-09-16 05:01:44,655 WARN  [resource.wrapper.LibvirtStartCommandWrapper] (agentRequest-Handler-5:null) (logid:287cef54) LibvirtException 
org.libvirt.LibvirtException: internal error: qemu unexpectedly closed the monitor: 2020-09-16T05:01:44.138805Z qemu-system-x86_64: error: failed to set MSR 0xe1 to 0x0
qemu-system-x86_64: /build/qemu-J4cYl4/qemu-4.2/target/i386/kvm.c:2691: kvm_buf_set_msrs: Assertion `ret == cpu->kvm_msr_buf->nmsrs' failed.
	at org.libvirt.ErrorHandler.processError(Unknown Source)
	at org.libvirt.Connect.processError(Unknown Source)
	at org.libvirt.Connect.processError(Unknown Source)
	at org.libvirt.Connect.domainCreateXML(Unknown Source)
	at com.cloud.hypervisor.kvm.resource.LibvirtComputingResource.startVM(LibvirtComputingResource.java:1612)
	at com.cloud.hypervisor.kvm.resource.wrapper.LibvirtStartCommandWrapper.execute(LibvirtStartCommandWrapper.java:85)
	at com.cloud.hypervisor.kvm.resource.wrapper.LibvirtStartCommandWrapper.execute(LibvirtStartCommandWrapper.java:45)
	at com.cloud.hypervisor.kvm.resource.wrapper.LibvirtRequestWrapper.execute(LibvirtRequestWrapper.java:78)
	at com.cloud.hypervisor.kvm.resource.LibvirtComputingResource.executeRequest(LibvirtComputingResource.java:1644)
	at com.cloud.agent.Agent.processRequest(Agent.java:645)
	at com.cloud.agent.Agent$AgentRequestHandler.doTask(Agent.java:1063)
	at com.cloud.utils.nio.Task.call(Task.java:83)
	at com.cloud.utils.nio.Task.call(Task.java:29)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)
2020-09-16 05:01:44,779 INFO  [kvm.storage.LibvirtStorageAdaptor] (agentRequest-Handler-5:null) (logid:287cef54) Trying to fetch storage pool fb4bb1df-cb02-3dfe-9a79-d37ee241d200 from libvirt
2020-09-16 05:01:48,900 INFO  [kvm.resource.LibvirtConnection] (agentRequest-Handler-1:null) (logid:287cef54) No existing libvirtd connection found. Opening a new one
2020-09-16 05:01:48,901 WARN  [kvm.resource.LibvirtConnection] (agentRequest-Handler-1:null) (logid:287cef54) Can not find a connection for Instance s-62-VM. Assuming the default connection.
2020-09-16 05:01:48,970 WARN  [kvm.resource.LibvirtKvmAgentHook] (agentRequest-Handler-1:null) (logid:287cef54) Groovy script '/etc/cloudstack/agent/hooks/libvirt-vm-state-change.groovy' is not available. Transformations will not be applied.
2020-09-16 05:01:48,971 WARN  [kvm.resource.LibvirtKvmAgentHook] (agentRequest-Handler-1:null) (logid:287cef54) Groovy scripting engine is not initialized. Data transformation skipped.
2020-09-16 05:02:13,275 INFO  [kvm.storage.LibvirtStorageAdaptor] (agentRequest-Handler-2:null) (logid:57bb906e) Trying to fetch storage pool 0e678d73-abb2-3295-b6c3-b6949a8a2f8d from libvirt
2020-09-16 05:02:13,299 INFO  [kvm.storage.LibvirtStorageAdaptor] (agentRequest-Handler-2:null) (logid:57bb906e) Trying to fetch storage pool 0e678d73-abb2-3295-b6c3-b6949a8a2f8d from libvirt
2020-09-16 05:02:13,344 WARN  [kvm.resource.LibvirtKvmAgentHook] (agentRequest-Handler-2:null) (logid:57bb906e) Groovy script '/etc/cloudstack/agent/hooks/libvirt-vm-xml-transformer.groovy' is not available. Transformations will not be applied.
2020-09-16 05:02:13,344 WARN  [kvm.resource.LibvirtKvmAgentHook] (agentRequest-Handler-2:null) (logid:57bb906e) Groovy scripting engine is not initialized. Data transformation skipped.
2020-09-16 05:02:14,100 WARN  [resource.wrapper.LibvirtStartCommandWrapper] (agentRequest-Handler-2:null) (logid:57bb906e) LibvirtException 
org.libvirt.LibvirtException: internal error: qemu unexpectedly closed the monitor: 2020-09-16T05:02:13.656588Z qemu-system-x86_64: error: failed to set MSR 0xe1 to 0x0

@rohityadavcloud
Copy link
Member

@ustcweizhou can you test in your env and provide results?
@davidjumani can you test manually and see if it works/doesn't work?

@rohityadavcloud
Copy link
Member

@weizhouapache
Copy link
Member

qemu-system-x86_64: error: failed to set MSR 0xe1 to 0x0

@davidjumani
I do not have this issue on my testing env.

are you using nested virtualization on a host with AMD cpu ?
you can try this workaround

echo 1 > /sys/modules/kvm/parameters/ignore_msrs

see https://patchwork.kernel.org/patch/42605/ for more details

@rohityadavcloud
Copy link
Member

ping @davidjumani can you try again?

Copy link
Contributor

@davidjumani davidjumani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Systemvms come up

@rohityadavcloud rohityadavcloud merged commit 00ceafe into apache:master Sep 22, 2020
@rohityadavcloud rohityadavcloud added this to the 4.15.0.0 milestone Sep 22, 2020
@rohityadavcloud
Copy link
Member

Merged based on Wido and David 's lgtms

ustcweizhou added a commit to ustcweizhou/cloudstack that referenced this pull request Sep 28, 2020
* security_group.py: fix SyntaxWarning: "is" with a literal.

2020-04-27 09:43:54,172 DEBUG [kvm.resource.LibvirtComputingResource] (Agent-Handler-2:null) (logid:c33ba330) /usr/share/cloudstack-common/scripts/vm/network/security_group.py:513: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if rules is None or rules is "":
/usr/share/cloudstack-common/scripts/vm/network/security_group.py:522: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if rules is None or rules is "":
/usr/share/cloudstack-common/scripts/vm/network/security_group.py:823: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if brName is None or brName is "":

* Ubuntu 20.04: Fix systemvm cannot start up

in Ubuntu 16.04:

root@node13:~# bridge -o link show
2: eth0 state UP : <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master cloudbr0 state forwarding priority 32 cost 100
5: vnet0 state UNKNOWN : <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master cloud0 state forwarding priority 32 cost 100
6: vnet1 state UNKNOWN : <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master cloudbr0 state forwarding priority 32 cost 100
7: vnet2 state UNKNOWN : <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master cloudbr0 state forwarding priority 32 cost 100

root@node13:~# bridge -o link show | awk '/master cloudbr0 / && !/^[0-9]+: vnet/ {print $2}' | head -1
eth0

root@node13:~# bridge -o link show | awk '/master cloudbr0 / && !/^[0-9]+: vnet/ {print $2}' | head -1 |cut -d ":" -f1
eth0

in Ubuntu 20.04:

root@node62:~# bridge -o link show
2: ens3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master cloudbr0 state forwarding priority 32 cost 100
10: vnet3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master cloud0 state forwarding priority 32 cost 100
11: vnet4: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master cloudbr0 state forwarding priority 32 cost 100
12: vnet5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master cloudbr0 state forwarding priority 32 cost 100

root@node62:~# bridge -o link show | awk '/master cloudbr0 / && !/^[0-9]+: vnet/ {print $2}' | head -1
ens3:

root@node62:~# bridge -o link show | awk '/master cloudbr0 / && !/^[0-9]+: vnet/ {print $2}' | head -1 |cut -d ':' -f1
ens3

* security_group.py: use 'if not' instead
ustcweizhou added a commit to ustcweizhou/cloudstack that referenced this pull request Oct 8, 2020
* security_group.py: fix SyntaxWarning: "is" with a literal.

2020-04-27 09:43:54,172 DEBUG [kvm.resource.LibvirtComputingResource] (Agent-Handler-2:null) (logid:c33ba330) /usr/share/cloudstack-common/scripts/vm/network/security_group.py:513: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if rules is None or rules is "":
/usr/share/cloudstack-common/scripts/vm/network/security_group.py:522: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if rules is None or rules is "":
/usr/share/cloudstack-common/scripts/vm/network/security_group.py:823: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if brName is None or brName is "":

* Ubuntu 20.04: Fix systemvm cannot start up

in Ubuntu 16.04:

root@node13:~# bridge -o link show
2: eth0 state UP : <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master cloudbr0 state forwarding priority 32 cost 100
5: vnet0 state UNKNOWN : <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master cloud0 state forwarding priority 32 cost 100
6: vnet1 state UNKNOWN : <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master cloudbr0 state forwarding priority 32 cost 100
7: vnet2 state UNKNOWN : <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master cloudbr0 state forwarding priority 32 cost 100

root@node13:~# bridge -o link show | awk '/master cloudbr0 / && !/^[0-9]+: vnet/ {print $2}' | head -1
eth0

root@node13:~# bridge -o link show | awk '/master cloudbr0 / && !/^[0-9]+: vnet/ {print $2}' | head -1 |cut -d ":" -f1
eth0

in Ubuntu 20.04:

root@node62:~# bridge -o link show
2: ens3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master cloudbr0 state forwarding priority 32 cost 100
10: vnet3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master cloud0 state forwarding priority 32 cost 100
11: vnet4: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master cloudbr0 state forwarding priority 32 cost 100
12: vnet5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master cloudbr0 state forwarding priority 32 cost 100

root@node62:~# bridge -o link show | awk '/master cloudbr0 / && !/^[0-9]+: vnet/ {print $2}' | head -1
ens3:

root@node62:~# bridge -o link show | awk '/master cloudbr0 / && !/^[0-9]+: vnet/ {print $2}' | head -1 |cut -d ':' -f1
ens3

* security_group.py: use 'if not' instead
rohityadavcloud pushed a commit that referenced this pull request Mar 4, 2021
…t "device" (#4740)

When running get_bridge_physdev(brname) from security_group.py it is returned the bridge device as brname: instead of the expected brname.

We experienced this issue on CloudStack 4.13.1.0 with Security Groups enabled for Advanced Networking. Additionally, KVM nodes are running on Ubuntu 18.04.

PR #4303 (merged in 4.15) added support for Ubuntu 20.04 which turned out to fix get_bridge_physdev(brname); however, we faced the very same issue with the previous CloudStack and Ubuntu versions.

Even though we might not get a 4.13.2, and CloudStack 4.14.1.0 has just been released, this PR proposes merging the fix into branch 4.13 and then get it forwarded into 4.14. Thus, allowing users to have this fix referenced and also opening the possibility of addressing this in case of a potential 4.14.2.0.
nlgordon pushed a commit to ippathways/cloudstack that referenced this pull request Aug 2, 2022
…t "device" (apache#4740)

When running get_bridge_physdev(brname) from security_group.py it is returned the bridge device as brname: instead of the expected brname.

We experienced this issue on CloudStack 4.13.1.0 with Security Groups enabled for Advanced Networking. Additionally, KVM nodes are running on Ubuntu 18.04.

PR apache#4303 (merged in 4.15) added support for Ubuntu 20.04 which turned out to fix get_bridge_physdev(brname); however, we faced the very same issue with the previous CloudStack and Ubuntu versions.

Even though we might not get a 4.13.2, and CloudStack 4.14.1.0 has just been released, this PR proposes merging the fix into branch 4.13 and then get it forwarded into 4.14. Thus, allowing users to have this fix referenced and also opening the possibility of addressing this in case of a potential 4.14.2.0.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants