-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add v4 vm start method with use_initialization
Since the version 4.3.1 of the ovirt-engine-sdk-ruby is possible to start a vm passing the use_initialization param. In this way, according to the VM's OS type it'll be possible to set the correct init section (cloudinit, sysprep, ignition)
- Loading branch information
Showing
4 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
lib/fog/ovirt/requests/compute/v4/vm_start_with_initialization.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
module Fog | ||
module Ovirt | ||
class Compute | ||
class V4 | ||
class Real | ||
def vm_start_with_initialization(options = {}) | ||
raise ArgumentError, "instance id is a required parameter" unless options.key? :id | ||
|
||
vm_service = client.system_service.vms_service.vm_service(options[:id]) | ||
vm_service.start(:use_initialization => true, :vm => { :initialization => options[:user_data] }) | ||
end | ||
end | ||
|
||
class Mock | ||
def vm_start_with_initialization(options = {}) | ||
raise ArgumentError, "instance id is a required parameter" unless options.key? :id | ||
true | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters