With the help of Azure portal, a Linux virtual machine is created. To create this, user needs to enter the username, password or SSH public key. Username is subject to the constraint, system account name present in the virtual machine is not permitted.
At the time of deploying virtual machine on Azure, specified user account is a privileged one. Azure Linux Agent will configure this account so that privileges can be elevated to root, means the superuser account, by using the utility of sudo. After logged, user can run the commands with the help of command syntax.
# sudo <COMMAND>
A root shell can be optionally obtained by sudo –s.
Configuration of Firewall
An inbound packet filter is offered by Azure by which connectivity to ports which are given in Azure portal are restricted. By default, only SSH port is allowed. If User wants to access some more ports on Linux virtual machine, it can be done through the configuration of the endpoints in Azure portal.
By default, iptables firewall is not enable using images of linux given in the Azure gallery. If User wish and wants some more filtering, firewall may be configured.
Changes in the Hostname
At the time of initial deployment of an image of linux, user needs to enter a hostname for the virtual machine. When virtual machine starts running, hostname is published to the DNS servers. This is done so that IP Address lookups can be performed by various virtual machines which are connected to each other, using hostnames.
If changes in the hostnames are required after the deployment of a virtual machine, following command will be used
# sudo hostname <newname>
In order to detect the change in name on automated basis and configuration of the virtual machine so that this change can be persist and same can be published to DNS Servers, by functionality of Azure linux Agent.
Cloud-init pn Azure is used by the images of CoreOS and Ubuntu, by whom more capabilities to bootstrap a virtual machine is offered.
Capture of Image of Virtual Machine
Azure is much capable of capturing virtual machine into the image which can be subsequently utilized for deploying instances of additional virtual machine. Customizations which were done while the process of provisioning is performed may be roll back by agent of Azure linux.
Following steps need to be performed for capturing a virtual machine in the form of image;
- In order to undo the provisioning customization, waggent – deprovision must be run. Waggent – deprovision + user, optionally, user account which is given at the time of provisioning must be deleted with all the associated data.
- Now virtual machine must be power off or shut down.
- Now to capture the virtual machine in the form of an image, make use of CLI tools or Powershell. Alternatively, User needs to click on ‘Capture’ in Azure classic portal.
Attaching the Disks
All the virtual machines has a local resource disk attached, not permanent. Data which is stored on resource disk is not durable all over the reboots and due to this, processes and applications which are running in the virtual machine used this for storing the data in a temporary and transient form. It can be used for storage of swap files or page for OS.
Azure Linux Agent manages the resource disk on Linux and mounted to /mnt/resource (or /mnt on Ubuntu images) on automated basis.
Data disk on Linux may be named by kernel as /dev/sdc and users are required to partition, format and mount those resources.