56 Commits

Author SHA1 Message Date
John Bampton
6f4503488b
pre-commit: apply end-of-file-fixer to all files (#7551) 2023-08-02 13:47:21 +02:00
Daniel Augusto Veronezi Salvador
81b7e6e750
Fix extract snapshot from vm snapshot on kvm (#6422)
* Fix extract snapshot from VM snapshot on KVM

* Fix validation expression - does not need to escape the slash

Co-authored-by: GutoVeronezi <daniel@scclouds.com.br>
2022-05-31 14:30:36 -03:00
John Bampton
c265df965e
Fix spelling (#6185)
* Fix spelling

* Update services/secondary-storage/server/src/main/java/org/apache/cloudstack/storage/resource/NfsSecondaryStorageResource.java

Co-authored-by: SadiJr <sadijacinto@gmail.com>

Co-authored-by: Rohit Yadav <rohityadav89@gmail.com>
Co-authored-by: SadiJr <sadijacinto@gmail.com>
2022-04-16 00:55:11 +05:30
Daniel Augusto Veronezi Salvador
39fad2d9d7
KVM disk-only based snapshot of volumes instead of taking VM's full snapshot and extracting disks (#5297)
* Refactor create volume snapshot with running VM

* Refactor create volume snapshot with stopped VM

* Refactor create volume from snapshot

* Refactor create template from snapshot

* Refactor volume migration (migrateVolume/ migrateVirtualMachineWithVolume)

* Refactor snapshot deletion

* Refactor snapshot revertion

* Adjusts and fix cherry-pick conflicts

* Remove diffuse tests

* Add validation to add flag '--delete' on command 'virsh blockcommand' only if libvirt version is equal or higher 6.0.0

* Expunge temporary snapshot only if template creation is from snapshot

* Extract strings to constant

* Remove unused imports

* Fix error on revert backed up snapshot

* Turn method's return to void as it is not used

* Rename method in SnapshotHelper

* Fix folder creation when using SharedMountPoint pool

* Remove static import

* Remove unnused method

* Cover take snapshot in centos 7

* Handle right snapshot flag according to qemu version

Co-authored-by: GutoVeronezi <daniel@scclouds.com.br>
2022-04-12 08:14:27 -03:00
Daniel Augusto Veronezi Salvador
4e90a8c454
Qemu 2.10 requires -U flag to read volume metadata (#4567)
Co-authored-by: Daniel Augusto Veronezi Salvador <daniel@scclouds.com.br>
2021-03-18 11:54:01 +01:00
davidjumani
d949302d0f
packaging: Adding Centos8, Ubuntu 20.04, XCPNG8.1 Support (#4068)
* DB : Add support for MySQL 8

- Splits commands to create user and grant access on database, the old
statement is no longer supported by MySQL 8.x
- `NO_AUTO_CREATE_USER` is no longer supported by MySQL 8.x so remove
that from db.properties conn parameters

For mysql-server 8.x setup the following changes were added/tested to
make it work with CloudStack in /etc/mysql/mysql.conf.d/mysqld.cnf and
then restart the mysql-server process:

    server_id = 1
    sql-mode="STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION,ERROR_FOR_DIVISION_BY_ZERO,NO_ZERO_DATE,NO_ZERO_IN_DATE,NO_ENGINE_SUBSTITUTION"
    innodb_rollback_on_timeout=1
    innodb_lock_wait_timeout=600
    max_connections=1000
    log-bin=mysql-bin
    binlog-format = 'ROW'

    default-authentication-plugin=mysql_native_password

Notice the last line above, this is to reset the old password based
authentication used by MySQL 5.x.

Developers can set empty password as follows:

    > sudo mysql -u root
    ALTER USER 'root'@'localhost' IDENTIFIED BY '';

In libvirt repository, there are two related commits

2019-08-23 13:13 Daniel P. Berrangé            ● rpm: don't enable socket activation in upgrade if --listen present
2019-08-22 14:52 Daniel P. Berrangé            ● remote: forbid the --listen arg when systemd socket activation

In libvirt.spec.in

        /bin/systemctl mask libvirtd.socket >/dev/null 2>&1 || :
        /bin/systemctl mask libvirtd-ro.socket >/dev/null 2>&1 || :
        /bin/systemctl mask libvirtd-admin.socket >/dev/null 2>&1 || :
        /bin/systemctl mask libvirtd-tls.socket >/dev/null 2>&1 || :
        /bin/systemctl mask libvirtd-tcp.socket >/dev/null 2>&1 || :

Co-authored-by: Wei Zhou <w.zhou@global.leaseweb.com>
Co-authored-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Co-authored-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2020-08-17 16:28:30 +05:30
Simon Weller
5db65a6363 kvm: Fixes #2868 libvirt resize notify failure (#2878)
Incorrect diskpath information was being sent to virsh blockresize, so the block device size was never refreshed to reflect the new disk size.
Fixes #2868
2018-10-05 18:35:09 +05:30
dahn
ed7811a9a2 CLOUDSTACK-10046 checksum validation for any java supported Digests-type (#2246)
* CLOUDSTACK-10046 digest helper for calculating checksums

* CLOUDSTACK-10046 cleanup unused checksum code

* CLOUDSTACK-10046 padding method proof of concept

* CLOUDSTACK-10046 only compare checksums if old value is valid

* Adding positive and negative tests for md5, sha-1 and sha-256, for xen, vmware and kvm hypervisors.
KVM Results:

 Negative Test Passed - Exception Occurred Under template download ['Traceback (most recent call last):\n', '  File "/Users/bstoyanov/Documents/sb2/cloudstack/test/integration/smoke/test_templates.py", line 189, in test_02_1_create_template_with_checksum_sha1_negative\n    self.download(self.apiclient, template.id)\n', '  File "/Users/bstoyanov/Documents/sb2/cloudstack/test/integration/smoke/test_templates.py", line 260, in download\n    template.status)\n', 'Exception: Failed to download template: status - Failed post download script: checksum "{sha-1}bf580a13f791d86acf3449a7b457a91a14389264" didn\'t match the given value, "{sha-1}someInvalidValue"\n']
=== TestName: test_02_1_create_template_with_checksum_sha1_negative | Status : SUCCESS ===
=== TestName: test_02_create_template_with_checksum_sha1 | Status : SUCCESS ===.
 Negative Test Passed - Exception Occurred Under template download ['Traceback (most recent call last):\n', '  File "/Users/bstoyanov/Documents/sb2/cloudstack/test/integration/smoke/test_templates.py", line 203, in test_03_1_create_template_with_checksum_sha256_negative\n    self.download(self.apiclient, template.id)\n', '  File "/Users/bstoyanov/Documents/sb2/cloudstack/test/integration/smoke/test_templates.py", line 260, in download\n    template.status)\n', 'Exception: Failed to download template: status - Failed post download script: checksum "{SHA-256}efc03633f2b8f5db08acbcc5dc1be9028572dfd8f1c6c8ea663f0ef94b458c5" didn\'t match the given value, "{SHA-256}someInvalidValue"\n']
=== TestName: test_03_1_create_template_with_checksum_sha256_negative | Status : SUCCESS ===
=== TestName: test_03_create_template_with_checksum_sha256 | Status : SUCCESS ===
 Negative Test Passed - Exception Occurred Under template download ['Traceback (most recent call last):\n', '  File "/Users/bstoyanov/Documents/sb2/cloudstack/test/integration/smoke/test_templates.py", line 217, in test_04_1_create_template_with_checksum_md5_negative\n    self.download(self.apiclient, template.id)\n', '  File "/Users/bstoyanov/Documents/sb2/cloudstack/test/integration/smoke/test_templates.py", line 260, in download\n    template.status)\n', 'Exception: Failed to download template: status - Failed post download script: checksum "{md5}ada77653dcf1e59495a9e1ac670ad95f" didn\'t match the given value, "{md5}someInvalidValue"\n']
=== TestName: test_04_1_create_template_with_checksum_md5_negative | Status : SUCCESS ===
=== TestName: test_04_create_template_with_checksum_md5 | Status : SUCCESS ===

* CLOUDSTACK-10046 digest helper for calculating checksums

* CLOUDSTACK-10046 cleanup unused checksum code

* CLOUDSTACK-10046 padding method proof of concept

* CLOUDSTACK-10046 only compare checksums if old value is valid

* Adding positive and negative tests for md5, sha-1 and sha-256, for xen, vmware and kvm hypervisors.
KVM Results:

 Negative Test Passed - Exception Occurred Under template download ['Traceback (most recent call last):\n', '  File "/Users/bstoyanov/Documents/sb2/cloudstack/test/integration/smoke/test_templates.py", line 189, in test_02_1_create_template_with_checksum_sha1_negative\n    self.download(self.apiclient, template.id)\n', '  File "/Users/bstoyanov/Documents/sb2/cloudstack/test/integration/smoke/test_templates.py", line 260, in download\n    template.status)\n', 'Exception: Failed to download template: status - Failed post download script: checksum "{sha-1}bf580a13f791d86acf3449a7b457a91a14389264" didn\'t match the given value, "{sha-1}someInvalidValue"\n']
=== TestName: test_02_1_create_template_with_checksum_sha1_negative | Status : SUCCESS ===
=== TestName: test_02_create_template_with_checksum_sha1 | Status : SUCCESS ===.
 Negative Test Passed - Exception Occurred Under template download ['Traceback (most recent call last):\n', '  File "/Users/bstoyanov/Documents/sb2/cloudstack/test/integration/smoke/test_templates.py", line 203, in test_03_1_create_template_with_checksum_sha256_negative\n    self.download(self.apiclient, template.id)\n', '  File "/Users/bstoyanov/Documents/sb2/cloudstack/test/integration/smoke/test_templates.py", line 260, in download\n    template.status)\n', 'Exception: Failed to download template: status - Failed post download script: checksum "{SHA-256}efc03633f2b8f5db08acbcc5dc1be9028572dfd8f1c6c8ea663f0ef94b458c5" didn\'t match the given value, "{SHA-256}someInvalidValue"\n']
=== TestName: test_03_1_create_template_with_checksum_sha256_negative | Status : SUCCESS ===
=== TestName: test_03_create_template_with_checksum_sha256 | Status : SUCCESS ===
 Negative Test Passed - Exception Occurred Under template download ['Traceback (most recent call last):\n', '  File "/Users/bstoyanov/Documents/sb2/cloudstack/test/integration/smoke/test_templates.py", line 217, in test_04_1_create_template_with_checksum_md5_negative\n    self.download(self.apiclient, template.id)\n', '  File "/Users/bstoyanov/Documents/sb2/cloudstack/test/integration/smoke/test_templates.py", line 260, in download\n    template.status)\n', 'Exception: Failed to download template: status - Failed post download script: checksum "{md5}ada77653dcf1e59495a9e1ac670ad95f" didn\'t match the given value, "{md5}someInvalidValue"\n']
=== TestName: test_04_1_create_template_with_checksum_md5_negative | Status : SUCCESS ===
=== TestName: test_04_create_template_with_checksum_md5 | Status : SUCCESS ===

* Adding additional test with no checksum added when registering template
Result:
test_05_create_template_with_no_checksum (integration.smoke.test_templates.TestCreateTemplateWithChecksum) ... === TestName: test_05_create_template_with_no_checksum | Status : SUCCESS ===
ok

----------------------------------------------------------------------
Ran 1 test in 42.320s

OK

* Fixing negative tests exception handling

* Adding tests for ISO checksum validation and fixing a zero prefix failure test in templates

* CLOUDSTACK-10046 padding

* CLOUDSTACK-10046 usability additions

* yet another IDE artifact hindering checkstyle
2017-10-11 11:49:06 +02:00
Daan Hoogland
70ef0788c9 CLOUDSTACK-9408: Fix download urls in sql and scripts
This fixes the agreed upon url on download.cloudstack.org in various
sql files and misc scripts.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2017-04-20 12:33:33 +05:30
Wei Zhou
9221cb3e0d CLOUDSTACK-9101: resize root volume of stopped vm on KVM 2015-12-03 14:54:49 +01:00
Wei Zhou
92344c006d CLOUDSTACK-5863: revert volume snapshot for KVM/QCOW2 2015-08-24 11:01:50 +02:00
Anshul Gangwar
aa7ae1b918 CLOUDSTACK-8416: added support for FIPS compliant checksum. It will now support md5, sha1, sha224, sha256, sha384 and sha512 checksums.
In same checksum parameter user can pass any of the above algorithms hash
This closes #196
2015-04-30 14:38:44 +05:30
Marcus Sorensen
9bf2626e57 CLOUDSTACK-8263: KVM - use virsh instead of libvirt for resizing qcow2, as libvirt bindings are insufficient
Change-Id: I08246219cb1469a46dc6a9ec76a8c3a67b0b8bf6
2015-02-17 18:09:41 -08:00
Marcus Sorensen
ed8184a5b2 CLOUDSTACK-8263: KVM - notify qemu process of resized volume for libvirt-resized storage
Change-Id: Iddd8bb068855d3565075d3ecf7c6c0f074d00e1a
2015-02-17 14:25:55 -08:00
Edison Su
0e3aebbb9d CLOUDSTACK-5446:
delete all the leftover snapshots on primary storage in case of snapshot
errors, after a new backup snapshot is finished
2014-11-19 15:53:06 -08:00
Rajesh Battala
67ff7dac82 CLOUDSTACK-7654 fixed issues with zip format templates. 2014-10-07 12:39:09 +05:30
Edison Su
f30fc6b673 need to check ccp-qemu-img 2014-08-12 15:13:42 -07:00
Edison Su
4fb4593553 CLOUDSTACK-4618: fix CLVM 2013-09-25 16:29:16 -07:00
Rene Diepstraten
53e6a1c0fa Removed unused script scripts/storage/qcow2/cleanupmyvms.sh
Signed-off-by: Rene Diepstraten <mail@renediepstraten.nl>
2013-07-17 18:35:38 +02:00
Edison Su
bf32776f9f be able to upload template into swift 2013-07-16 18:07:06 -07:00
Edison Su
34f6538454 CLOUDSTACK-2970: wait is in seconds in command 2013-06-14 17:57:34 -07:00
Min Chen
18aeef3ef1 Merge branch 'master' (up to commit
c30d9be3cea30339cfff40c1002906634291b373) into object_store.
2013-06-12 11:20:32 -07:00
Anthony Xu
0b728f2e77 remove unused file 2013-05-29 13:51:22 -07:00
Edison Su
492127c035 fix kvm 2013-05-12 18:27:37 -07:00
Marcus Sorensen
0ca85659a6 CLOUDSTACK-1651 - point agent scripts to correct logging location, due to move
of /var/log/cloud to /var/log/cloudstack

Signed-off-by: Marcus Sorensen <marcus@betterservers.com> 1363112422 -0600
2013-03-12 12:20:22 -06:00
Marcus Sorensen
750fb2c31e Summary: Fix improper variable assignment in resizevolume.sh (remove $)
Signed-off-by: Marcus Sorensen <marcus@betterservers.com> 1360089640 -0700
2013-02-05 11:40:40 -07:00
Marcus Sorensen
8c5b82dfb4 Summary: several scripts are not mode executable
Detail: several scripts in the scripts directory weren't marked executable.
Normally this is handled/fixed in the packaging, but harder to deal with in
development environments, so marking them executable.

Signed-off-by: Marcus Sorensen <marcus@betterservers.com> 1358446902 -0700
2013-01-17 11:21:42 -07:00
Marcus Sorensen
1ff7a147bd Revert "Summary: fix ipsectunnel.sh being called as ipsectunnel in KVM S2S vpn"
This reverts commit 1a2e69fb22a64b84960860965d4f757637ac5e12.
accidentally pushed mode change of sh file as well, need to split this out
2013-01-17 11:17:43 -07:00
Marcus Sorensen
1a2e69fb22 Summary: fix ipsectunnel.sh being called as ipsectunnel in KVM S2S vpn
Signed-off-by: Marcus Sorensen <marcus@betterservers.com> 1358446410 -0700
2013-01-17 11:13:30 -07:00
Marcus Sorensen
975021dda1 Summary: adding resizeVolume api call
Detail: This merges the resizevolume feature branch, which provides the
ability to migrate a disk between disk offerings, thereby changing its
size, or specifying a new size if current disk offering is custom.

BUG-ID: CLOUDSTACK-644
Signed-off-by: Marcus Sorensen <marcus@betterservers.com> 1358358209 -0700
2013-01-16 17:43:35 -07:00
Marcus Sorensen
7ce2227108 Summary: master - Copy qcow2 instead of converting if source and dest are qcow2
Detail: If source image is qcow2, and we want a qcow2 image, then doing a
convert strips off compression and any snapshots the user had in that image. If
a backing file exists, we stick with convert so we can pull in both the backing
file and the COW image, otherwise we just cp the qcow2 file. This is also faster

Signed-off-by: Marcus Sorensen <marcus@betterservers.com> 1354755241 -0700
2012-12-05 17:54:01 -07:00
Marcus Sorensen
a91df8f32d Summary: master - Fix typo in createvolume.sh
Detail: createvolume.sh had '$qemu-img' in one spot instead of '$qemu_img' as it
uses everywhere else

Signed-off-by: Marcus Sorensen <marcus@betterservers.com> 1354754792 -0700
2012-12-05 17:46:32 -07:00
Edison Su
263216caa5 Adds CLVM as an option for primary storage. It copies most of the RBD bits, in most cases simply adding an 'else if' or similar. In the managesnapshot.sh we add the ability to manipulate snapshots for the CLVM volumes, as well as a few minor fixes like adjusting the usage for the -b option to reflect that it accepts four arguments (note that it already accepted four args, it just wasn't reflected in the usage).
RB: https://reviews.apache.org/r/6470/
Send-by: shadowsor@gmail.com
2012-08-10 13:33:06 -07:00
David Nalley
d630fa8697 license header changes for scripts folder from Chip Childers 2012-06-23 00:58:00 -04:00
butanet
2c001bbe21 Fix variable name in createtmplt.sh 2012-05-28 14:18:47 -04:00
butanet
f5eefc0493 Fix variable name in createtmplt.sh ($tmplfs -> $tmpltfs) 2012-05-28 14:13:37 -04:00
Nitin Mehta
d77af1a96c bug CS-14941: Revert accidental chages to the create template script for KVM 2012-05-21 09:11:40 +05:30
Edison Su
bafc3f2a5a CS-14521
Remove CLVM, due to license issue
2012-05-15 15:13:15 -07:00
Nitin Mehta
4434aa0d2d bug CS-10789: More changes for the imageformat, introdueced new column in db for the format, created scripts for doffernt hypervisors ...and the list goes on. 2012-04-23 13:44:34 +05:30
frank
2f634c0913 Switch to Apache license 2012-04-03 04:50:05 -07:00
kishan
606902ff09 Bug 11931: Add quotes to snapshot name and volume name. Fixed create template from snapshot also by adding quotes
Status 11931: resolved fixed
Reviewed-By: Nitin

Conflicts:

	scripts/storage/qcow2/createtmplt.sh
2012-02-08 17:24:17 +05:30
Edison Su
738a5927a8 quote the snapshot name 2012-01-31 16:23:34 -08:00
frank
52610ffcb3 add copyright header to shell scripts 2012-01-11 18:41:53 -08:00
Edison Su
c067763075 bug 12604: if there are actually snapshots creating on the volume, then don't move the snapshot
status 12604: resolved fixed
2011-12-20 15:12:31 -08:00
Edison Su
6841e265d3 bug 10330: finally merge Rommer's CLVM patch
status 10330: resolved fixed
2011-11-02 18:03:58 -07:00
Edison Su
d18a1ddc28 fix the long time issue that sometimes libvirt reports volume missing 2011-09-02 01:01:27 -07:00
Edison Su
8bcad6960c add rhel6.1 support 2011-07-29 20:05:01 -07:00
Frank
92155522f2 Add license header to files 2011-04-14 11:23:14 -07:00
Edison Su
c4ac92af3f fix destroy snapshot 2011-03-09 10:20:05 -05:00
Edison Su
c80335c9df bug 8783: user vm fs is crashed, use O_DIRECT instead of O_DSYNC/O_SYNC in qemu, aka cache=none. Hope we can reduce the possibility of guest vm crashed.
status 8783: resolved fixed
2011-03-01 16:38:23 -05:00