148 Commits

Author SHA1 Message Date
Pearl Dsilva
830f3061bc
SystemVM optimizations (#5831)
* Support for live patching systemVMs and deprecating systemVM.iso. Includes:
- fix systemVM template version
- Include agent.zip, cloud-scripts.tgz to the commons package
- Support for live-patching systemVMs - CPVM, SSVM, Routers
- Fix Unit test
- Remove systemvm.iso dependency

* The following commit:
- refactors logic added to support SystemVM deployment on KVM
- Adds support to copy specific files (required for patching) to the hosts on Xenserver
- Modifies vmops method - createFileInDomr to take cleanup param
- Adds configuratble sleep param to CitrixResourceBase::connect() used to verify if telnet to specifc port is possible (if sleep is 0, then default to _sleep = 10000ms)
- Adds Command/Answer for patch systemVMs on XenServer/Xcp

* - Support to patch SystemVMs - VMWare
- Remove attaching systemvm.iso to systemVMs
- Modify / Refactor VMware start command to copy patch related files to the systemvms
- cleanup

* Commit comprises of:
- remove docker from systemvm template - use containerd as container runtime
- update create-k8s-binaries script to use ctr for all docker operations
- Update userdata sent to the k8s nodes
- update cksnode script, run during patching of the cks/k8s nodes

* Add ssh to k8s nodes details in the Access tab on the UI

* test

* Refactor ca/cert patching logic

* Commit comprises of the following changes:
- Use restart network/VPC API to patch routers
- use livePatch API support patching of only cpvm/ssvm
- add timeout to the keystore setup/import script

* remove all references of systemvm.iso

* Fix keystore-cert-import invocation + refactor cert timeout in CP/SS VMs

* fix script timeout

* Refactor cert patching for systemVMs + update keystore-cert-import script + patch-sysvms script + remove patchSysvmCommand from networkelementcommand

* remove commented code + change core user to cloud for cks nodes

* Update ownership of ssh directory

* NEED TO DISCUSS - add on the fly template conversion as an ExecStartPre action (systemd)

* Add UI changes + move changes from patch file to runcmd

* test: validate performance for template modification during seeding

* create vms folder in cloudstack-commons directory - debian rules

* remove logic for on the fly template convert + update k8s test

* fix syntax issue - causing issue with shared network tests

* Code cleanup

* refactor patching logic - certs

* move logic of fixing rootdiskcontroller from upgrade to kubernetes service

* add livepatch option to restart network & vpc

* smooth upgrade of cks clusters

* Support for live patching systemVMs and deprecating systemVM.iso. Includes:
- fix systemVM template version
- Include agent.zip, cloud-scripts.tgz to the commons package
- Support for live-patching systemVMs - CPVM, SSVM, Routers
- Fix Unit test
- Remove systemvm.iso dependency

* The following commit:
- refactors logic added to support SystemVM deployment on KVM
- Adds support to copy specific files (required for patching) to the hosts on Xenserver
- Modifies vmops method - createFileInDomr to take cleanup param
- Adds configuratble sleep param to CitrixResourceBase::connect() used to verify if telnet to specifc port is possible (if sleep is 0, then default to _sleep = 10000ms)
- Adds Command/Answer for patch systemVMs on XenServer/Xcp

* - Support to patch SystemVMs - VMWare
- Remove attaching systemvm.iso to systemVMs
- Modify / Refactor VMware start command to copy patch related files to the systemvms
- cleanup

* Commit comprises of:
- remove docker from systemvm template - use containerd as container runtime
- update create-k8s-binaries script to use ctr for all docker operations
- Update userdata sent to the k8s nodes
- update cksnode script, run during patching of the cks/k8s nodes

* Add ssh to k8s nodes details in the Access tab on the UI

* test

* Refactor ca/cert patching logic

* Commit comprises of the following changes:
- Use restart network/VPC API to patch routers
- use livePatch API support patching of only cpvm/ssvm
- add timeout to the keystore setup/import script

* remove all references of systemvm.iso

* Fix keystore-cert-import invocation + refactor cert timeout in CP/SS VMs

* fix script timeout

* Refactor cert patching for systemVMs + update keystore-cert-import script + patch-sysvms script + remove patchSysvmCommand from networkelementcommand

* remove commented code + change core user to cloud for cks nodes

* Update ownership of ssh directory

* NEED TO DISCUSS - add on the fly template conversion as an ExecStartPre action (systemd)

* Add UI changes + move changes from patch file to runcmd

* test: validate performance for template modification during seeding

* create vms folder in cloudstack-commons directory - debian rules

* remove logic for on the fly template convert + update k8s test

* fix syntax issue - causing issue with shared network tests

* Code cleanup

* add cgroup config for containerd

* add systemd config for kubelet

* add additional info during image registry config

* address comments

* add temp links of download.cloudstack.org

* address part of the comments

* address comments

* update containerd config - as version has upgraded to 1.5 from 1.4.12 in 4.17.0

* address comments - simplify

* fix vue3 related icon changes

* allow network commands when router template version is lower but is patched

* add internal LB to the list of routers to be patched on network restart with live patch

* add unit tests for API param validations and new helper utilities - file scp & checksum validations

* perform patching only for non-user i.e., system VMs

* add test to validate params

* remove unused import

* add column to domain_router to display software version and support networkrestart with livePatch from router view

* Requires upgrade column to consider package (cloud-scripts) checksum to identify if true/false

* use router software version instead of checksum

* show N/A if no software version reported i.e., in upgraded envs

* fix deb failure

* update pom to official links of systemVM template
2022-04-21 13:40:19 -03:00
Paul Angus
be97470d83 Get Diagnostics: Download logs and diagnostics data from SSVM, CPVM, Router (#3350)
* * Complete API implementation
* Complete UI integration
* Complete marvin test
* Complete Secondary storage GC background task

* improve UI labels

* slight reword and add another missing description

* improve download message clarity

* Address comments

* multiple fixes and cleanups

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

* fix more bugs, let it return ip rule list in another log file

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

* fix missing iprule bug

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

* add support for ARCHIVE type of object to be linked/setup on secstorage

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

* Fix retrieving files for Xenserver

* Update get_diagnostics_files.py

* Fix bug where executable scripts weren't handled

* Fixed error on script cmd generation

* Do not filter name for log files as it would override similar prefix script names

* Addressed code review comments

* log error instead of printstacktrace

* Treat script as executable and shell script

* Check missing script name case and write to output instead of catching exception

* Use shell = true instead of shlex to support any executable

* fix xenserver bug

* don't set dir permission for vmware

* Code review comments - refactoring

* Add check for possible NPE

* Remove unused imoprt after rebase

* Add better description for configs

Co-authored-by: Nicolas Vazquez <nicovazquez90@gmail.com>
Co-authored-by: Rohit Yadav <rohit@apache.org>
Co-authored-by: Anurag Awasthi <anurag.awasthi@shapeblue.com>
2020-01-15 11:38:33 +01:00
Gabriel Beims Bräscher
34030be393
Fix XenServer Security Groups 'vmops' script (#3197)
* Fix XenServer Security Groups 'vmops' script

- fix tokens = line.split(':') to tokens = line.split(';')
- fix expected tokens size from 5 to 4
- enhance logs
- remove unused vmops script. The XCP patch points to the vmops script
on the parent folder [1]. Thus, all XenServer versions are considering
the vmops script located at [2].
- fix UI ipv4/ipv6 cidr validator to allow a list of cidirs.

Fixing issue: #3192 Security Group rules not applied at all for
XenServer 6.5 / Advanced Zone
https://github.com/apache/cloudstack/issues/3192

* Update security group rules after VM migration

Add security group rules on target host
Cause: vmops script expected secondary IPs as "0;" but received "0:"

Remove security group network rules on source host.
Cause: destroy_network_rules_for_vm function on vmops script was not
called when migrating VM

* Add unit tests and address reviewers
2019-03-06 09:13:40 -03:00
Wido den Hollander
632479d8f8 CLOUDSTACK-9853: Add support for Secondary IPv6 Addresses and Subnets (#2028)
This commit adds support for passing IPv6 Addresses and/or Subnets as
Secondary IPs.

This is groundwork for CLOUDSTACK-9853 where IPv6 Subnets have to be
allowed in the Security Groups of Instances to we can add DHCPv6
Prefix Delegation.

Use ; instead of : for separating addresses, otherwise it would cause
problems with IPv6 Addresses.

Signed-off-by: Wido den Hollander <wido@widodh.nl>
2017-11-22 17:30:33 +05:30
Rajani Karuturi
c95b47b740 Merge pull request #1824 from jayapalu/SGipset
CLOUDSTACK-9657: Fixed security group ipset issues with long vm name
2017-05-19 14:05:51 +05:30
Jayapal
43a991d2eb CLOUDSTACK-9821: Fixed issue in deploying vm in basic zone 2017-03-06 19:01:15 +05:30
Jayapal
1cff18fcfa CLOUDSTACK-9657: Fixed security group ipset issues with long vm name 2017-02-24 15:20:04 +05:30
Jayapal
175c8d83b8 CLOUDSTACK-8871: fixed issue with the xenserver 6.2 ipset nethash 2017-02-20 18:34:13 +05:30
Jayapal
59e6596fef Fixed issue in adding vm SG rules on vm reboot for xenserver 6.5
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

This closes #479
2015-06-18 13:32:00 +03:00
Rohit Yadav
496ffcad83 CLOUDSTACK-8395: vmops plugin should work on both XS 6.5 and 6.2
This fixes the issue of Security Groups not working in case of XenServer 6.5;
- Uses nethash ipset data-structure to store CIDRs (efficient than iphash and
  avoids overflow errors in case users add /8 /4 ingress/egress cidrs)
- Support for ipset versions both on 6.2 and 6.5, both have different outputs. This
  fixes the issue of destroy_network_rules_for_vm failing
- Implements defensive filtering of list, instead of popping last item without
  checking if it's None or empty
- Greps using names that are 'quoted' to avoid bash errors
- Before setting up new network rule, tries to clean and remove old ipset entry
- Idents, whitespace and naming fixes

PS. This is my 1000th commit to the 🐵 project :)

This closes #186

(cherry picked from commit d91d161107e20ffc8ec088ee55f99d6743330946)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

Conflicts:
	scripts/vm/hypervisor/xenserver/vmops
2015-04-23 14:15:36 +02:00
Jayapal
619f014255 CLOUDSTACK-8298: Update copying large size VR config file in xenserver
When there is large size VR configuration (aggregate commands) copying data to VR using vmops plugin was failed
 because of the ARG_MAX size limitation. The configuration data size is around 300KB.

 Updated this to create file in host by scp with file contents. This will create file in host.
 Then copy the file from the host to VR using hte vmops createFileInDomr method.

  In host file get created in /tmp/ with name VR-<UUID>.cfg, once it copied to VR this file will be removed.
2015-03-04 11:52:10 +05:30
Rohit Yadav
06437dadf5 CLOUDSTACK-8220: Let's have a separate XenServer 6.5 resource
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-02-06 14:44:10 +05:30
Anthony Xu
fbe205b9dd remove unused XS plugins 2014-10-21 10:53:48 -07:00
Anthony Xu
bd6f03aa95 iptreemap is not supported in new ipset, use iphash instead 2014-08-25 11:22:30 -07:00
Frank.Zhang
88f866645b fix iptables chain name too long (must be under 30 chars) 2014-07-18 17:31:06 -07:00
Anthony Xu
733102c742 change XS log file name from vmops.log to cloud.log 2014-07-15 11:07:15 -07:00
Sheng Yang
e8227c88d8 CLOUDSTACK-6314: Use SSH commands for Xen VR execution
Instead of XAPI, which would make XenServer unnecessary busy.
2014-04-07 13:38:14 -07:00
Anthony Xu
2dc1c7bec8 get rrd through http directly instead of xapi plugins 2014-03-26 18:04:41 -07:00
Sheng Yang
3e097a0fb2 CLOUDSTACK-5779: Clean up leftover VR script in Xen 2014-03-11 13:22:14 -07:00
Sheng Yang
2d100f1269 CLOUDSTACK-5779: Generalize calling to execute or create file for Xen 2014-01-24 18:27:55 -08:00
Sheng Yang
e88cc488e5 CLOUDSTACK-5779: Move loadbalancer to use routerProxy 2014-01-20 18:48:46 -08:00
Sheng Yang
0ea1c7dfc4 CLOUDSTACK-5779: Move firewall to use routerProxy 2014-01-17 12:36:42 -08:00
Sheng Yang
ce67e24d0a CLOUDSTACK-5779: Move ipAlias to use routerProxy 2014-01-17 12:36:42 -08:00
Sheng Yang
0cdf0f6f67 CLOUDSTACK-5779: Moving bumpUpPriority, edithosts.sh, dnsmasq.sh to use routeProxy 2014-01-16 16:03:09 -08:00
Anthony Xu
1ddc0b99fe put CS/XS plugin log into seperate directory 2013-12-10 01:23:46 -08:00
Anthony Xu
c17cf2595b after XS host reboot, all SG rules are gone, need to check if SG rules frame is there when program rules for VM, if not , create the SG rule frame 2013-12-05 02:10:59 -08:00
Anthony Xu
5a062e155c put shell scripts to a seperate directory in XS
use same scripts for both XS and XCP
2013-12-03 02:05:34 -08:00
Anthony Xu
27294a3827 CLOUDSTACK-4750
use interface wildcard "+" in iptables to cover potential used VLAN interface to allow output on physical interface.

you will see
 0     0 ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           PHYSDEV match --physdev-out bond2+ --physdev-is-bridged
instead of
 0     0 ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           PHYSDEV match --physdev-out bond2.1234 --physdev-is-bridged

Anthony
2013-10-30 15:12:21 -07:00
Jayapal
b79b2182ef CLOUDSTACK-4624 Fixed security groups rules program issue in Advaced SG VM migration 2013-10-21 17:41:36 +05:30
Jayapal
137ee50477 CLOUDSTACK-4613 correcting anti spoofing security group rules 2013-09-06 15:47:02 +05:30
anthony
4333209af3 CLOUDSTACK-3495
CS used to access vnc server in xenserver dom0 to get VM console, now CS moves to use XenServer console API. getvncport plugin is not needed any more.
        remove the code related to getvncport in XenServer
2013-08-09 17:22:54 -07:00
Marcus Sorensen
ac59a4f136 Summary: Move Xen vmdata to new, non-ssh method
Detail: KVM recently got a patch that did away with a few dozen ssh calls
when programming virtual router (CLOUDSTACK-3163), saving several seconds
for each vm served by the virtual router when the router is rebooted. This
patch updates Xen to use the same method, and cleans up the old script refs.

Reviewed-by: Sheng Yang, Prasanna Santhanam
2013-07-30 21:45:36 -06:00
Anthony Xu
f1fb7c3efe in security group, CS put a rule in ebtables filter table FORWARD chain to prevent user from changing VM mac address
util.pread2(['ebtables', '-A', vm_chain, '-i', vif, '-s', '!', vm_mac,  '-j', 'DROP'])

if user changes the VM mac address, all egress packet from the VM will be dropped, but the egress packet still contaminate the bridge cache with fake MAC,

This patch moves the rule to ebtables nat table PREROUTING chain, then the egress packet with modified MAC will not contaminate the bridge cache.

Anthony
2013-07-30 17:04:21 -07:00
Bharat Kumar
9c24be4837 CLOUDSTACK-3871 XEN - Unable to deploy VM in guest network VLAN with different subnets
Signed-off-by: Sheng Yang <sheng.yang@citrix.com>
2013-07-28 23:43:44 -07:00
Bharat Kumar
e14f5d0aeb Cloudstack-3694 Dnsmasq rewrite in bash
(Sheng: Fix typo, fix log and error message, remove 'set -x' in script)

Signed-off-by: Sheng Yang <sheng.yang@citrix.com>
2013-07-24 14:00:31 -07:00
hongtu_zang
9d857c0362 fix xenserver 6.1 and 6.2 can not open vnc console
Signed-off-by: Abhinandan Prateek <aprateek@apache.org>
2013-07-12 16:35:17 +05:30
Anthony Xu
fdc9f10cc1 fix , Windows 2008 32bit instance can't get IP address,
normally, in dhcp reply, the target ip is allocated ip for VM.
but windows 2008 32bit has special field in dhcp reply, which makes dhcp reply use 255.255.255.255 as target ip, which is blocked by SG rule,
2013-05-29 16:01:22 -07:00
Harikrishna Patnala
ffe90c0059 CLOUDSTACK-2085: VM weight on xen remain same as before vmscaleup ;because "Add-To-VCPUs-Params-Live.sh" is not getting copied on xs host
Fixed by updating the patch files that has
 entries to copy scipts on xenserver. Here we added
 Add-To-VCPUs-Params-Live.sh

Added a check on Host params whether host restricts Dynamic memory control(DMC) to able to allow scale up VM.
If DMC is not enabled then static max and min are set to SO.

Signed Off by - Nitin Mehta <nitin.mehta@citrix.com>
2013-05-15 16:17:21 +05:30
Anthony Xu
1518e7ee43 CLOUDSTACK-2115: remove the trailing '\n' to get correct XS network mode 2013-05-14 17:52:10 -07:00
Bharat Kumar
052c24c4d1 CLOUDSTACK-702: Multiple ip ranges in different subnets.
This feature enables adding of guest ip ranges (public ips)  form different subnets.

In order to provide the dhcp service to a different subnet we create an ipalias on the router. This allows the router to listen to the dhcp request from the guest vms and respond accordingly. Every time a vm is deployed in the new subnet we configure an ip alias on the router. Cloudstack uses dnsmasq to provide dhcp service. We need to configure the dnsmasq to issue ips on the new subnets. Added a new class dnsmasqconfigurator which generates the dnsmasq confg file, this file replaces the old config in the router.

The details of the alias ips are stored in db in the nic_ip_alias table. Every time a new subnet is added one of the ip from the subnet is used to configure the ip alias.

I have pushed the code to  https://github.com/bvbharatk/cloud-stack/tree/Cloudstack-702 , also rebased the code with master.
I need to test the code for advanced sg enabled network using kvm.

I have added the unit test
Marvin tests are at https://git-wip-us.apache.org/repos/asf?p=cloudstack.git;h=53e4965

Also accomodated some of the changes suggested by koushik.
corrected the import statements. renamed the IpAlias command to createIpAlias command.

This feature supports only ipv4
2013-05-13 17:06:44 +05:30
Nitin Mehta
3e4430d811 CLOUDSTACK-658 - Scaleup vm support for Xenserver
Added the framweork so that it can be extended for vmware and kvm as well.
Added unitests and marvin tests.
2013-03-28 16:43:37 +05:30
Jayapal Uradi
a49261c3b1 CLOUDSTACK-24: mipn feature for basiczone
Signed-off-by: Abhinandan Prateek <aprateek@apache.org>
2013-03-13 10:24:22 +05:30
Nitin Mehta
b12aebefee Revert "CLOUDSTACK-658 - Adding Scalevm command and XS related changes"
This reverts commit e0019eccd997d9b2b3ff9395bcd99f821f5121db.
2013-03-04 23:32:52 +05:30
Nitin Mehta
e0019eccd9 CLOUDSTACK-658 - Adding Scalevm command and XS related changes 2013-03-04 14:47:55 +05:30
anthony
db71d3da36 CLOUDSTACK-1167
remove arptables rules after VM is stopped
2013-02-05 15:07:29 -08:00
Anthony Xu
acaa22003d CLOUDSTACK-184: add createFileInDomr plugin 2012-09-24 16:11:04 -07:00
anthony
541fec8b46 Bug 13734 : after upgrade, dhcp traffic is allowed for all VMs
reviewed-by: kelven
2012-09-07 17:31:11 -07:00
Anthony Xu
b58123e075 CS-15921 : in 2.1 timeframe, -untagged string is appended to the end of instance name,
in cleanup_rules function, we need to convert chain name to vm name correclty
2012-09-07 17:25:41 -07:00
Anthony Xu
33fdcf1047 CS-16261:
egress_vmchain doesn't exist in 2.2.*, create it automatically after upgrade
2012-09-07 17:07:10 -07:00
anthony
2ea876dfd3 in basic zone, allow dhcp traffic by default 2012-08-15 13:11:58 -07:00