VM Creation
It is time to create a VM.
- To get a hash of a password, we will use the mkpasswd utility.
$ sudo apt install whois
$ mkpasswd
Password: mypassword
$y$j9T$0/PuSDxIvi6GlhLZ6ddOI1$K9KTlLvUvH9eNzRA06EpagXsSds/tHTYTUTdDFbfv81 - Next, we will create a JSON file that describes my VM. The command
node-client -desc vmcreate
can provide more information about the JSON file format.configs/test-vm.json{
"vm_mem" :"4",
"vm_core" :"4",
"vm_img_size":"64",
"os_variant" :"ubuntu24.04",
"vm_img_type":"local",
"localpath" :"/storage/VM/images/",
"fstype" :"ext4",
"ipaddr" :"dhcp",
"username" :"cluster-admin",
"passwd" :"$y$j9T$0/PuSDxIvi6GlhLZ6ddOI1$K9KTlLvUvH9eNzRA06EpagXsSds/tHTYTUTdDFbfv81"
} - It's finally time to create the VM.
Depending on the host and network, it will take some time for the VM auto-installation to be done. When it is done, the status of VM will be shut-off.
$ node-client -S localhost -c vmcreate -v test-vm -f configs/test-vm.json
If you want to check the progress, you may connect to the vnc of the VM console. The VNC connection detail can be retrieved using node-client as well.$ node-client -S localhost -c list
$ node-client -S localhost -c vncdisplay -v test-vm
- Once the installation is finished, we start the test-vm, connect to it, and begin work.
Once the VM is in shut-off state, we start the VM.To find the IP address assigned by DHCP, we again use node-client command.$ node-client -S localhost -c vmstart -v test-vm
$ node-client -S localhost -c vm-domain-info -v test-vm -key ipaddr
- Now, we can connect to the VM through ssh using the IP provided by the previous command.
In this walk-through, our purpose is to demonstrate how to set up node-wizard and node client so that we can create a VM. To have concise and environment-independent commands, we use the same host for Node Wizard and Node Client. Normally, Node Client is not on a KVM host and handles multiple KVM hosts remotely.
Node Wizard supports many more features than just automated VM creation. It offers:
- VM life cycle management
- network (vxlan, vlan, bridge) creation
- snapshots
- templates / cloning
- attaching disks and bridges
- attaching host devices like GPUs and network devices such as Virtual Functions
- network storage via Ceph RDB
For more information, see Node Client usage page.