$ oc edit <object_type> <object_ID>
You can update a virtual machine configuration using either the YAML editor in the web console or the OpenShift client on the command line. You can also update a subset of the parameters in the Virtual Machine Overview of the web console.
Edit select values of a virtual machine in the Virtual Machine Overview screen of the web console by clicking on the pencil icon next to the relevant field. Other values can be edited using the CLI.
Click Workloads → Virtual Machines from the side menu.
Select a virtual machine to open the Virtual Machine Overview screen.
Click the pencil icon to make that field editable.
Make the relevant changes and click Save.
If the virtual machine is running, changes will not take effect until you reboot the virtual machine.
Using the web console, edit the YAML configuration of a virtual machine.
Not all parameters can be updated. If you edit values that cannot be changed and click Save, an error message indicates the parameter that was not able to be updated.
The YAML configuration can be edited while the virtual machine is Running, however the changes will only take effect after the virtual machine has been stopped and started again.
Navigating away from the YAML screen while editing cancels any changes to the configuration you have made. |
Click Workloads → Virtual Machine from the side menu.
Select a virtual machine.
Click the YAML tab to display the editable configuration.
Optional: You can click Download to download the YAML file locally in its current state.
Edit the file and click Save.
A confirmation message shows that the modification has been successful and includes the updated version number for the object.
Use this procedure to edit a virtual machine YAML configuration using the CLI.
You configured a virtual machine with a YAML object configuration file.
You installed the oc
CLI.
Run the following command to update the virtual machine configuration.
$ oc edit <object_type> <object_ID>
Open the object configuration.
Edit the YAML.
If you edit a running virtual machine, you need to do one of the following:
Restart the virtual machine
Run the following command for the new configuration to take effect.
$ oc apply <object_type> <object_ID>
Use this procedure to add a virtual disk to a virtual machine.
From the Virtual Machines tab, select your virtual machine.
Select the Disks tab.
Click Add Disks to open the Add Disk window.
In the Add Disk window, specify Source, Name, Size, Interface, and Storage Class.
Use the drop-down lists and check boxes to edit the disk configuration.
Click OK.
Use this procedure to add a network interface to a virtual machine.
From the Virtual Machines tab, select the virtual machine.
Select the Network Interfaces tab.
Click Add Network Interface.
In the Add Network Interface window, specify the Name, Model, Network, Type, and MAC Address of the network interface.
Click Add to add the network interface.
Restart the virtual machine to enable access.
Edit the drop-down lists and check boxes to configure the network interface.
Click Save Changes.
Click OK.
The new network interface displays at the top of the Create Network Interface list until the user restarts it.
The new network interface has a Pending VM restart
Link State until you
restart the virtual machine. Hover over the Link State to display more
detailed information.
The Link State is set to Up by default when the network interface card is defined on the virtual machine and connected to the network.
Use the following procedure to configure CD-ROMs for virtual machines.
From the Virtual Machines tab, select your virtual machine.
Select the Overview tab.
To add or edit a CD-ROM configuration, click the pencil icon to the right of the CD-ROMs label. The Edit CD-ROM window opens.
If CD-ROMs are unavailable for editing, the following message displays: The virtual machine doesn’t have any CD-ROMs attached.
If there are CD-ROMs available, you can remove a CD-ROM by clicking -.
In the Edit CD-ROM window, do the following:
Select the type of CD-ROM configuration from the drop-down list for Media Type. CD-ROM configuration types are Container, URL, and Persistent Volume Claim.
Complete the required information for each Type.
When all CD-ROMs are added, click Save.