160 Commits

Author SHA1 Message Date
Jayapal
deb694c201 CLOUDSTACK-8324: Added migration changes for config drive 2015-07-10 09:39:27 +05:30
Daan Hoogland
6376503fe3 coverity 1308118: more resources being opened only one closed on exception nothing was closed
Signed-off-by: Daan Hoogland <daan@onecht.net>
2015-07-09 21:30:23 +02:00
weingartner
25e9918c57 Amend last commit, used 4 spaces in code formatting instead of 1 tab character.
Signed-off-by: wilderrodrigues <wrodrigues@schubergphilis.com>

This closes #560
2015-07-09 13:37:59 +02:00
weingartner
50c4836c9f Cleaned class “com.cloud.hypervisor.xenserver.resource.XcpOssResource” that seemed to be forgotten during the evolution of the ACS. It was removed a few methods that were already coded properly in its parent class “com.cloud.hypervisor.xenserver.resource.CitrixResourceBase”. It was also removed some methods that seemed to cause weird behaviors. The methods removed/fixed are detailed as follows: • com.cloud.hypervisor.xenserver.resource.XcpOssResource.fillHostInfo(Connection, StartupRoutingCommand) – it was removed, because it always added the string “, hvm” to the host capabilities. Therefore, if one uses XCP hypervisor it could cause a lot of trouble when deploying HVM virtual machines in an environment that has PV and HVM clusters. The method is already properly coded in parent class. • com.cloud.hypervisor.xenserver.resource.XcpOssResource.launchHeartBeat(Connection) – It was removed. It was not performing anything and always returns a true value. The method of parent class is properly coded and works for XCP environments. The heartbeat plugin exists in XCP environment. • com.cloud.hypervisor.xenserver.resource.XcpOssResource.initializeLocalSR(Connection) – it was removed. The method of the parent class works properly for XCP environments. • com.cloud.hypervisor.xenserver.resource.XcpOssResource.createPatchVbd(Connection, String, VM) – It was removed. This method causes a bug in XCP environments, because of its half-implementation, it was not possible to migrate system VMs. The parent class implementation works properly for XCP. • com.cloud.hypervisor.xenserver.resource.XcpOssResource.execute(NetworkUsageCommand) – removed, hence it was already coded into parent class and its respective wrappers (“com.cloud.hypervisor.xenserver.resource.wrapper.xcp.XcpServerNetworkUsageCommandWrapper”). BTW: I noticed that the class XcpServerNetworkUsageCommandWrapper and XenServer56NetworkUsageCommandWrapper are almost the same, with the exception that XenServer56NetworkUsageCommandWrapper deals with VPC. I believe that those wrappers could be converted into one, and moved to parent. I am not doing that here because I do not have a XCP environment with advanced networking to test it. • com.cloud.hypervisor.xenserver.resource.XcpOssResource.executeRequest(Command) – removed, hence it is not needed anymor. • com.cloud.hypervisor.xenserver.resource.XcpOssResource.execute(StopCommand) – I did not understand that method. It seemed weird and its removal did not change any behavior of the environment I tested it with.
Signed-off-by: wilderrodrigues <wrodrigues@schubergphilis.com>
2015-07-09 13:37:59 +02:00
wilderrodrigues
e348e76eee CLOUDSTACK-8607 - Improving unit tests
- Adding more unit tests as suggested by Daan and Rajani.
   - Mocking SshHelper and the Script classes, used by Citrix and Libvirt resources respectively.
2015-07-06 14:58:17 +02:00
wilderrodrigues
86297e70be CLOUDSTACK-8607 - Make sure the new password replaces the old one in the queue
- Added log info to show details of the operation
   - Renamed the addPwdToQueue to replaceOldPasswdInQueue
2015-07-04 11:33:52 +02:00
wilderrodrigues
efa34361df CLOUDSTACK-8607 - Changed update script to return exit code based on the result
- Changed location of the update_host_passwd script
   - Updated the patch files for XenServer
   - Updated the script path on LibvirtComputing class
   - Removed the hostIP from the LibvirtUpdateHostPasswordCommandWrapper execute() method
2015-07-03 14:29:57 +02:00
wilderrodrigues
0dd02ce043 CLOUDSTACK-8607 - Adding support to update host passwd on XenServer hypervisors
- Adding update_host_passwd to VRScripts
   - Add accessor method to host password on CitrixResourceBase
   - Add implementation to CitrixUpdateHostPasswordCommandWrapper
   - Improve testUpdateHostPasswordCommand() unit test on CitrixRequestWrapperTest
   - Add line to patch files on xenserver directory

Concerning the LibVirt change:

   - I forgot to assing the return of the getDefaultHypervisorScriptsDir() method to the hypervisorScriptsDir variable
2015-07-03 10:24:44 +02:00
Sanjay Tripathi
9044a02d9a VM Snapshot Usage for DATA disk is reported as the size of the DATA disk instead of the actual snapshot size.
This closes #485
2015-06-19 15:55:21 +05:30
Sanjay Tripathi
d702b63bfb CLOUDSTACK-8569: The latter snapshot export for the same volume will fail is 2 snapshot exports are queued
This closes #469
2015-06-17 15:27:03 +05:30
Sanjay Tripathi
47278556f5 CLOUDSTACK-8567 Migrating primary storage causes name_label field to blank.
This closes #468
2015-06-17 14:46:51 +05:30
Rafael da Fonseca
be474f95a1 Fixed 4 findbugs warnings in CitrixResourceBase.java Unnecessary boxing/unboxing of primitive values
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

This closes #425
2015-06-15 12:09:39 +03:00
Rafael da Fonseca
b869a16332 Remove unused import to fix checkstyle warning
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

This closes #400
2015-06-15 12:04:19 +03:00
Rafael da Fonseca
949e97dec6 Fix findbugs warning in LibvirtConsoleProxyLoadCommandWrapper Encoding is now specified in both server and clients for the console proxy getstatus command For some reason, findbugs did not detect unsafe encoding issue in ConsoleProxyResource.java, is properly specified now though... CitrixConsoleProxyLoadCommandWrapper was specifying system default encoding for operation, should be ok because default for xenserver is UTF-8 since it's linux based, but it's best to specify exact encoding set on the server end to be consistent
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-06-15 12:04:18 +03:00
Rafael da Fonseca
cc6d28fc98 Fix another findbugs encoding warning in CitrixResourceBase In this case, using default encoding is desired, since the purpose is to read shell command output, which uses the platform's default encoding. This gets rid of the findbugs warning.
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

This closes #396
2015-06-15 11:59:48 +03:00
Rafael da Fonseca
faa38ad416 Fix findbugs encoding warning in CitrixResourceBase Output of text files should be UTF-8, this is the default for linux, will now always use the same format for every platform
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

This closes #395
2015-06-15 11:59:38 +03:00
wilderrodrigues
b267c5fc5a Replacing real IPs by 127.0.0.1. - It was causing problems in some environments - The Ips should have been removed in a previous commit, but some of them were missed
Signed-off-by: wilderrodrigues <wrodrigues@schubergphilis.com>

This closes #325
2015-05-29 11:25:40 +02:00
Jayapal
b616522088 CLOUDSTACK-8324: Corrected the file paths for xenserver command files
This closes #315
2015-05-28 17:02:09 +05:30
Jayapal
6e96fc6f38 CLOUDSTACK-8324: Updated import and added ResourceWrapper annotation 2015-05-28 15:56:37 +05:30
Jayapal
3a8d1f7c55 CLOUDSTACK-8324: Added unit test cases for GetVmIpAddressCommand 2015-05-28 15:56:37 +05:30
Jayapal
e407986183 CLOUDSTACK-8324: Added config drive support for xenserver 2015-05-28 15:51:50 +05:30
Jayapal
7984ae5283 CLOUDSTACK-8324: Resource base changes for vm ip fetch 2015-05-28 15:42:08 +05:30
wilderrodrigues
b155129ae8 Fixing the packaging of the Xen resource tests - The package declaration of all Test classes was point to a package that was not represented as a directory - For example: Class A had "package b.c.d;" as declaration, but the class A was under directory "c"
Maven was bulding the project and executing the tests just fine because it uses "-sourcepath". However,
with IDEs and javac it would fail.

Signed-off-by: wilderrodrigues <wrodrigues@schubergphilis.com>

This closes #317
2015-05-27 16:06:33 +02:00
Rafael da Fonseca
79d24ae218 Fix xenserver tests for travis 2015-05-23 16:14:09 +02:00
wilderrodrigues
add4277720 CLOUDSTACK-8502
Added CitrixStorageSubSystemCommandWrapper to complete the CitrixResourceBase refactor.
  - All 101 unit tests are green
2015-05-21 13:59:49 +02:00
wilderrodrigues
7ff1a81cee CLOUDSTACK-8502
Using Annotations on the Citrix wrappers in order to increase maintainability
  - All wrappers modified
  - All 100 unit tests are green
2015-05-21 13:36:55 +02:00
wilderrodrigues
ab7473eea0 Changing the JUnit runner in order to avoid problems with Java 8 - All tests passed using different approaches - Maven with parameters: -Dmaven.compiler.source=1.8 -Dmaven.compiler.target=1.8 - Maven without parameters
All builds were executed using javac 1.8.0_31

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

This closes #266
2015-05-20 09:53:46 +01:00
wilderrodrigues
7319a12600 Refactoring the LibvirtComputingResource
- Adding LibvirtCheckConsoleProxyLoadCommandWrapper, LibvirtConsoleProxyLoadCommandWrapper, LibvirtWatchConsoleProxyLoadCommandWrapperand CitrixConsoleProxyLoadCommandWrapper
  - 2 unit tests added
  - KVM hypervisor plugin with 12% coverage

Refactored the CommandWrapper interface in order to remove the esecuteProxyLoadScan, which is now
implemented bu subclasses.
2015-05-06 19:20:43 +02:00
wilderrodrigues
508f10527f Refactoring the LibvirtComputingResource
- Adding LibvirtStopCommandWrapper
  - LibvirtRequestWrapper
  - 1 unit tests

Refactored the RequestWrapper to make it better.
  - Changes also applied to the CitrixRequestWrapper
2015-05-06 19:20:39 +02:00
Anshul Gangwar
866cc41145 CLOUDSTACK-8423: [Xenserver] Improved the performance for processing of ClusterVMMetaDataSync command which can cause slowness in DB if there are huge number of VMs
this closes #204
2015-04-30 14:44:36 +05:30
wilderrodrigues
3b0c031b9f Using the SSHCmdHelper instead of a SSH Session. 2015-04-29 13:05:21 +02:00
Daan Hoogland
cb02a32f79 findbugs: boxing/unboxing removed 2015-04-12 20:16:13 +02:00
Daan Hoogland
72b2422623 findbugs: removed identical override for CitrixResourceBase method
transferManagementNetwork
2015-04-12 20:10:20 +02:00
Daan Hoogland
332da26cb9 findbugs: unused retry count causing unintended useless null guard 2015-04-12 19:58:05 +02:00
wilderrodrigues
096d1b93b0 This closes #146
Refactoring the NetworkUsageCommand wrapper in order to cope with new design
   - Unit tests added: 100% coverage
2015-04-05 13:24:45 +02:00
wilderrodrigues
02d1cdd49a Refactoring the MigrateVolumeCommand wrapper in order to cope with new design
- Unit tests added: 43.1% coverage
   - It's a bit difficult to test the Xen API classes due to their static nature
2015-04-05 09:23:10 +02:00
wilderrodrigues
f6e162afe4 Refactoring the MigrateWithStorageCompleteCommand wrapper in order to cope with new design
- Unit tests added: 50% coverage
   - It's a bit difficult to test the Xen API classes due to their static nature
2015-04-05 09:23:10 +02:00
wilderrodrigues
d5414d26b4 Refactoring the MigrateWithStorageSendCommand wrapper in order to cope with new design
- Unit tests added: 47.2% coverage
   - It's a bit difficult to test the Xen API classes due to their static nature
2015-04-05 09:23:10 +02:00
wilderrodrigues
c5a2f926e0 Refactoring the MigrateWithStorageReceiveCommand wrapper in order to cope with new design
- Unit tests added: 65% coverage
   - It's a bit difficult to test the Xen API classes due to their static nature
2015-04-05 09:23:09 +02:00
wilderrodrigues
858b87f01c Refactoring the MigrateWithStorageCommand wrapper in order to cope with new design
- Unit tests added: 30.1% coverage
   - It's a bit difficult to test the Xen API classes due to their static nature
2015-04-05 09:23:09 +02:00
wilderrodrigues
240bcb8120 Refactoring the GetGPUStatsCommand wrapper in order to cope with new design
- Unit tests added: 100% coverage
2015-04-05 09:23:09 +02:00
wilderrodrigues
bcee7281c6 Started refctoring the remaining XenServer resources
- Just cleaning the formating
2015-04-05 09:23:09 +02:00
wilderrodrigues
3f89cd6494 Adding license headers that made RAT fail
- Test classes affected

This closes #143
2015-04-03 10:43:30 +02:00
wilderrodrigues
57d0931b49 Adding more tests to cover other possibilities concerning different versions of the XenServer
Adding a better algorithm in order to corver deeper inheritance form the command classes
Removing some unsued variables.
2015-03-31 16:49:48 +02:00
wilderrodrigues
d93935caac We don't need the Start, Stop, Reboot command in the CitrixRebaseClaas anymore. 2015-03-31 10:38:33 +02:00
wilderrodrigues
3ad30a01a8 Refactoring XenServer56NetworkUsageCommandWrapper in order to cope with the new design
- Unit tests added
CitrixResourceBase, XenServer56Resource and XenServer56FP1Resource are now done.

i
2015-03-31 10:38:33 +02:00
wilderrodrigues
f3842c81f8 Refactoring XenServer56 and 56FP1 Resources in order to cope with new FenceCommandWrapper
- Unit tests added

Also removed an unit test that was doing nothing.
2015-03-31 10:38:33 +02:00
wilderrodrigues
4600eef87c Removing all private/protected/public execute() methods from CitrixResourceBase class
Started the refactor of the XenServer56Resource class
  - Unit test added
Changing the CitrixRequestWrapper in order to cope with multiple resources classes and commands

Still have to remove few methods form CitrixResourceBase
2015-03-31 10:38:32 +02:00
wilderrodrigues
02571728c6 Refactored the remaining commands
- Unit tests added

In the executeRequest I needed to keep the following:

// We need this one because the StorageSubSystemCommand is from another hierarchy.
        if (cmd instanceof StorageSubSystemCommand) {
            return storageHandler.handleStorageCommands((StorageSubSystemCommand) cmd);
        }
2015-03-31 10:38:32 +02:00
wilderrodrigues
24bbfbc1e6 Refactoring other 8 command wrapper in order to cope with the new design
- Advanced unit tests added for half of the commands
  - Basic unit tests added for the other half
2015-03-31 10:38:32 +02:00