New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compute v2: Add Live Migration Action #728
Conversation
Changes Unknown when pulling fd197c6 on dstdfx:server-live-migration into ** on gophercloud:master**. |
Build succeeded.
|
fd197c6
to
36c6c90
Compare
Build failed.
|
b8706ed
to
4f5656e
Compare
Build succeeded.
|
@jtopjian This is ready for review, but I've got -0.0003% as a decreased coverage after some refactoring, is it possible to skip it ? |
@dstdfx I think we can let that slide 😉 Thank you for working on this. I'll have time to do a full review in the next day or so. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dstdfx Nice work. I have one nit and one questions.
Additionally, I won't be able to run the acceptance test for this since I don't have a multi-node test environment on-hand at the moment. I'll take your word that the acceptance test works 😄
But that brings up a good point: the OpenLab CI environment probably can't run this test, either, so we will want to use an environment variable to trigger when this can be run.
Can you add a field called LiveMigrate
(bool) here.
Then set the value by checking if OS_LIVE_MIGRATE
is set here. Don't error if it's not set.
Add the LiveMigrate
field here, too.
Then in the acceptance test, check if choices.LiveMigrate
is false. If so, do t.Skip()
.
You can obtain choices
by doing this.
Let me know if you need help with this - I realize it is a unique request for this test.
note: The reason we don't do this for the other Migrate test is because Nova can migrate to the same host (if nova.conf
is set accordingly).
|
||
// The host to which to migrate the server. | ||
// If this parameter is None, the scheduler chooses a host. | ||
Host *string `json:"host"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this so you can specify ""
as a valid host value? Is that different than if host
was omitted from the request body?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jtopjian It will be "valid", but I reckon that "host" has to be always in the request body according to this line.
Moreover there's no clear mention as for migrate-server-migrate-action
If you specify null or don’t specify this parameter, the scheduler chooses a host.
I might be wrong please correct me.
|
||
// LiveMigrateOpts specifies parameters of live migrate action. | ||
type LiveMigrateOpts struct { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: can you remove this line?
Build succeeded.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dstdfx Looks good! Thank you for implementing this.
Two small changes.
With regard to the Host
setting, are you able to test whether or not Host
needs to be ""
or if it can be omitted?
acceptance/clients/clients.go
Outdated
@@ -56,6 +60,7 @@ func AcceptanceTestChoicesFromEnv() (*AcceptanceTestChoices, error) { | |||
shareNetworkID := os.Getenv("OS_SHARE_NETWORK_ID") | |||
dbDatastoreType := os.Getenv("OS_DB_DATASTORE_TYPE") | |||
dbDatastoreVersion := os.Getenv("OS_DB_DATASTORE_VERSION") | |||
liveMigrate := os.Getenv("OS_LIVE_MIGRATE") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be easier to do this:
var liveMigrate bool
if v := os.Getenv("OS_LIVE_MIGRATE"); v != "" {
liveMigrate = true
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jtopjian Unfortunately I can't test it on my environment
} | ||
|
||
if !choices.LiveMigrate { | ||
t.Skip() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about
t.Skip("Testing of live migration is disabled")
Build succeeded.
|
Do you mean you can't test this PR at all? |
@jtopjian Sorry for balls-up! Finally I've tested cases with omitted
|
@dstdfx Thank you for getting that information :) I realize this PR is more difficult to test, so if you weren't able to test, it's understandable. I would have picked it up at some point in the future. But since you can test it, that's great. So it looks like Nova does not like when What about Host string `json:"host"` That should put |
@jtopjian Are you sure? As far as I know we will get |
I apologize. I misunderstood that So we've confirmed that all options are correct, then, right? |
@jtopjian Right |
In that case, this looks good to me. Thank you for your help and patience with this one -- it's really appreciated. |
For #520
The same for Openstack CLI:
openstack server migrate --live <hostname> <server-name-or-id>
Links to the line numbers/files in the OpenStack source code that support the
code in this PR:
API doc:
Source code: