-
Notifications
You must be signed in to change notification settings - Fork 1.8k
CNV-46346: Adding docs for controller revisions #99504
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,67 @@ | ||
// Module included in the following assemblies: | ||
// | ||
// * virt/virtual_machines/creating_vm/virt-creating-vms-from-instance-types.adoc | ||
|
||
:_mod-docs-content-type: PROCEDURE | ||
[id="virt-change-vm-instance-type-cli_{context}"] | ||
= Changing the instance type of a VM by using the CLI | ||
|
||
[role="_abstract"] | ||
To change the instance type of a VM, change the `name` field in the VM spec. This triggers the update logic, which ensures that a new, immutable controller revision snapshot is taken of the new resource configuration. | ||
|
||
.Prerequisites | ||
|
||
* You have installed the {oc-first}. | ||
* You created the VM by using an instance type, or have administrator privileges for the VM that you want to modify. | ||
|
||
.Procedure | ||
|
||
. Stop the VM. | ||
|
||
. Run the following command, and replace `<vm_name>` with the name of your VM, and `<new_instancetype>` with the name of the instance type you want to change to: | ||
+ | ||
[source,terminal] | ||
---- | ||
$ oc patch vm/<vm_name> --type merge -p '{"spec":{"instancetype":{"name": "<new_instancetype>"}}}' | ||
---- | ||
|
||
.Verification | ||
|
||
* Check the controller revision reference in the updated VM `status` field. Run the following command and verify that the revision name is updated in the output: | ||
+ | ||
[source,terminal] | ||
---- | ||
$ oc get vms/<vm_name> -o json | jq .status.instancetypeRef | ||
---- | ||
+ | ||
*Example output* | ||
+ | ||
[source,terminal] | ||
---- | ||
{ | ||
"controllerRevisionRef": { | ||
"name": "vm-cirros-csmall-csmall-3e86e367-9cd7-4426-9507-b14c27a08671-2" | ||
}, | ||
"kind": "VirtualMachineInstancetype", | ||
"name": "csmall" | ||
} | ||
---- | ||
|
||
* Optional: Check that the VM instance is running the new configuration defined in the latest controller revision. For example, if you updated the instance type to use 2 vCPUs instead of 1, run the following command and check the output: | ||
+ | ||
[source,terminal] | ||
---- | ||
$ oc get vmi/<vm_name> -o json | jq .spec.domain.cpu | ||
---- | ||
+ | ||
*Example output that verifies that the revision uses 2 vCPUs* | ||
+ | ||
[source,terminal] | ||
---- | ||
{ | ||
"cores": 1, | ||
"model": "host-model", | ||
"sockets": 2, | ||
"threads": 1 | ||
} | ||
---- |
This file contains hidden or 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 hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.