Skip to content

BUG-ID: CLOUDSTACK-8484 - Hosts without tag are not listed while list… - #335

Closed
sudhansu7 wants to merge 2 commits into
apache:4.5from
sudhansu7:CLOUDSTACK-8484
Closed

sudhansu7 wants to merge 2 commits into
apache:4.5from
sudhansu7:CLOUDSTACK-8484

Conversation

@sudhansu7

Copy link
Copy Markdown

…ing the hosts for migration for instance with tag

While preparing the suitable hosts we are accidentally removing the incompatible (host does not have host tag) hosts from other host list(incorrect use of List.retainAll).

@asfbot

asfbot commented May 30, 2015

Copy link
Copy Markdown

cloudstack-pull-requests #278 SUCCESS
This pull request looks good

@karuturi

karuturi commented Jun 4, 2015

Copy link
Copy Markdown
Member

Can you add some unit/marvin tests?
Also, fix the commit msg header to 72 :) http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html

@yadvr

yadvr commented Jun 12, 2015

Copy link
Copy Markdown
Member

LGTM, I guess unit tests would be cool.

@remibergsma

Copy link
Copy Markdown
Contributor

Code looks good, although I didn't test it yet. Before I do, I'd like to understand why do you want to push this to 4.5 and not to master?

@sebgoa

sebgoa commented Jul 2, 2015

Copy link
Copy Markdown
Member

@sudhansu7 there is a question here from @remibergsma , can you answer it so it can get merged.

@sudhansu7

Copy link
Copy Markdown
Author

@remibergsma @Runseb
This issue exists in 4.5 , hence fixed it in 4.5. this can me merged to master as well.

@remibergsma

Copy link
Copy Markdown
Contributor

@sudhansu7 Let's first merge this to master, then it can go to 4.5. I just tried to merge your PR on master and that seems to work just fine so that is nice.

There were two other questions: about unit tests and one about the commit message. If you could respond to that please? In the mean time, I'll go ahead and give it a test run.

listing the hosts for migration for instance with tag

While preparing the suitable hosts we are accidentally removing the
incompatible (host does not have host tag) hosts from otherhost list(
incorrect use of List.retainAll).
listing the hosts for migration for instance with tag
Added marvin test for this issue.
Steps
         1. Create a Compute service offering with the tag.
         2. Create a Guest VM with the compute service offering
            created above.
         3. find hosts to migrate the vm crated above

Validations
         1. Ensure that the offering is created with the
            tag.The listServiceOffering API should list show tag
         2. findHostsForMigration cmd should list both suitable
            and not-suitable hosts
@sudhansu7

Copy link
Copy Markdown
Author

@remibergsma @karuturi
I have added marvin test for this issue also fixed the commit message.
Test result from local setup:

Sudhansus-MAC:cloudstack sudhansu$ nosetests --with-marvin --marvin-config=setup/dev/advanced.cfg ./test/integration/smoke/find_hosts_for_migration.py

==== Marvin Init Started ====

=== Marvin Parse Config Successful ===

=== Marvin Setting TestData Successful===

==== Log Folder Path: /tmp//MarvinLogs//Jul_03_2015_17_38_01_JVMT7H. All logs will be available here ====

=== Marvin Init Logging Successful===

==== Marvin Init Successful ====
===final results are now copied to: /tmp//MarvinLogs/find_hosts_for_migration_FKMWAR===
Sudhansus-MAC:cloudstack sudhansu$ cat /tmp//MarvinLogs/find_hosts_for_migration_FKMWAR/results.txt
Test find suitable and not-suitable list of hosts for migration ... === TestName: test_01_find_hosts_for_migration | Status : SUCCESS ===
ok


Ran 1 test in 27.003s

OK
Sudhansus-MAC:cloudstack sudhansu$ cat /tmp//MarvinLogs/find_hosts_for_migration_FKMWAR/failed_plus_exceptions.txt

Sudhansus-MAC:cloudstack sudhansu$ cat /tmp//MarvinLogs/find_hosts_for_migration_FKMWAR/runinfo.txt | grep -i 'Suitable Hosts'
2015-07-03 17:38:18,171 - DEBUG - Suitable Hosts: set([])
2015-07-03 17:38:18,171 - DEBUG - Not suitable Hosts: set([{cpuwithoverprovisioning : u'32000.0', version : u'4.5.2-SNAPSHOT', memorytotal : 8589934592, jobstatus : 0, zoneid : u'7a83176c-4ae7-49cc-88ff-a794716e74f9', cpunumber : 4, managementserverid : 4278190080, cpuallocated : u'0%', memoryused : 0, id : u'b1b25f17-18f7-4b4d-a8e1-a353ebf33660', cpuused : u'0%', suitableformigration : False, clusterid : u'c138587b-c149-4819-9d30-d4fa9d6d5da4', capabilities : u'hvm', state : u'Up', memoryallocated : 1879048192, networkkbswrite : 16384, cpuspeed : 8000, type : u'Routing', events : u'Ping; StartAgentRebalance; ShutdownRequested; ManagementServerDown; HostDown; AgentDisconnected; PingTimeout; Remove; AgentConnected', zonename : u'Sandbox-simulator', podid : u'b0b72cfb-db0a-4e9c-a9da-84854d8c4a1f', clustertype : u'CloudManaged', hahost : False, lastpinged : u'1970-01-17T11:01:01+0530', ipaddress : u'172.16.15.21', disconnected : u'2015-07-03T14:32:16+0530', name : u'SimulatedAgent.3481871b-7626-450a-b2c1-ab4e6a2e5965', networkkbsread : 32768, created : u'2015-07-03T13:39:27+0530', clustername : u'C0', hypervisor : u'Simulator', islocalstorageactive : False, resourcestate : u'Enabled', requiresStorageMotion : False, podname : u'POD0'}])

@karuturi

karuturi commented Jul 6, 2015

Copy link
Copy Markdown
Member

Awesome @sudhansu7. Congratulations on the first marvin test 👍 :)
I will push this to master in sometime.

@asfgit asfgit closed this in f1a6490 Jul 6, 2015
yadvr pushed a commit that referenced this pull request Jan 20, 2021
Fixes #335

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
shwstppr pushed a commit to shapeblue/cloudstack that referenced this pull request Nov 3, 2023
…running management server (apache#335)

* Run recalculation recurrent task only in the longest running management server

* Fix timeout and recalculation when no child domains

(cherry picked from commit 3f35e3a6ef24017d2f63613ca4362521b1ee78b6)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
shwstppr pushed a commit to shapeblue/cloudstack that referenced this pull request Nov 3, 2023
This adds the missing commit to the fix apache#335 from the upstream PR:
apache#7977

(cherry picked from commit b5f77f9c3b53af7e8b05730da9807a2c9eb017a5)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants