Information Technology Reference
In-Depth Information
Creating and editing a virtual machine
In order to create and edit a virtual machine, use the following commands:
• To create a new virtual machine from CLI, use the existing virtual machine tem-
plates and run the following command:
[RHEVM shell (connected)]# add vm --name vmfrmcli
--descripton "virtual machine created from cli"
--cluster-name Web-Cluster --template-name RHEL6Web
This command will create a new virtual machine named vmfrmcli in a cluster
named Web-Cluster from the existing virtual machine template RHEL6Web.
• To list a virtual machine that is currently powered on, run the following command.
It's equivalent to searching the virtual machine, which is in the up status from the
search bar of the admin portal:
[RHEVM shell (connected)]# list vms --query "status=up"
• To list a virtual machine that is currently powered off, run the following command:
[RHEVM shell (connected)]# list vms --query
"status=down"
• To start a powered-down virtual machine, run the following command:
[RHEVM shell (connected)]# action vm vmfrmcli start
status-state: complete
vm-id : f7466164-8a80-4e11-b121-4e290876fc08
[RHEVM shell (connected)]#
• To connect to a virtual machine console, run the following command:
[RHEVM shell (connected)]# console vmfrmcli
• To remove a virtual machine, disable the delete protection of the virtual machine
first before attempting to remove the virtual machine. To disable the delete protec-
tion of a virtual machine, run the following command:
[RHEVM shell (connected)]# update vm vmfrmcli
--delete_protected False
Search WWH ::




Custom Search