Web Console Access for Azure Virtual Machine? - azure

There's any way to access a Virtual Machine with boot problems in windows azure ?
i have a linux VM and i misconfigured a swap file causing boot problems
but Azure dont let me check the details.
In the portal i only have the option to restart or shutdown or delete.
When i google at the problem the only solution i found is:
Download Azure Hard Disk Drive attached to virtual machinne
Mount it locally on a Virtual Instance on my PC
Fix the configuration and save it
Upload the whole HD back to azure VM and pray.
Any other solutions ?
DigitalOcean has a webinterface that let you see the boot procces on your VMs. There is something like this on azure ?

When i contact Azure Support they give this solution:
As console access is not an available feature yet in Azure, you will basically be mounting the problem OS disk as a data disk on a working VM to correct changes to the file system configuration:
A = Original VM (Inaccessible VM)
B = New VM (New Temp VM)
1) Stop VM A via the Azure management portal
2) Delete VM A BUT select “keep the attached disks”
3) Once the lease is cleared, attach the Data Disk from A to VM B via the Azure Portal, Virtual Machines, Select “A”, Attach Disk
4) On VM “B” eventually the disk will attach and you can then mount it.
5) Locate the drive name to mount, on VM “B” look in relevant log file note each linux is slightly different.
grep SCSI /var/log/kern.log (ubuntu)
6) Mount the attached disk onto mountpoint /tempmount
df -h
mkdir /tempmount
mount /dev/sdc1 /tempmount
df –h
7) Change into /etc directory where the original OS disk from resides
cd /tempmount/etc/
cp fstab fstab_orig
8) Now that you have made a backup of you fstab you can proceed to make the changes you require using vi, nano or your preferred text editor.
vi fstab
cd /
umount /tempmount
9) Detach the disk from VM B via the management portal
10) Recreate the original VM A (Create VM from Gallery, Select My Disks) you will see the Disk referring to VM A – Select the original Cloud Service name.
i think that there is the best solution for now.

Related

Unable to mount file share on Linux VM

I have two Linux Azure VMs (Redhat 7.4) that need share a common location for processing files. The VMs are located in Australia East.
I also have a Storage Account that's in Australia East and have created a file share in the Storage Account. I generated the commands to connect the VMs to the file share (by clicking on the file share, then choosing "Connect"), but I get this error when I run the final generated command in the VM:
sudo mount -t cifs //<storageaccount>/<fileshare> /mnt/<storageaccount>/<fileshare> -o vers=3.0,credentials=/etc/smbcredentials/<storageaccount>.cred,dir_mode=0777,file_mode=0777,serverino
... I get this message:
mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
I've run the file diagnostic tool script (https://gallery.technet.microsoft.com/Troubleshooting-tool-for-02184089) in the VM and got this error:
Error: Client is not Azure VM in the region as Storage account, mount will fail
I'm confused as it seems to be saying that the VMs and Storage Account are in different locations, when they aren't.
Thanks in advance for any assistance.
I can reproduce this same issue with Redhat 7.4. To fix this, you can make sure that Secure transfer required setting is disabled on the storage account. View more info. Or verify that you input the correct value in each of the parameters in the commands. You could refer to these steps to mount the Azure file share.
sudo mount -t cifs $smbPath $mntPath -o vers=3.0,username=$storageAccountName,password=$storageAccountKey,serverino

MarkLogic - Forest data folder & Azure Blob

Technical Stack
MarkLogic 9.0
Cenos Linux
Azure Blob
Blobfuse
To make sure we do not have to worry about data disk size for MarkLogic Forest, we have configured Azure Blob to one of folder in Linux machine, so we do not have to worry about disk size.
There are few things i noticed
Need to create folder in Linux
Create folder and point it to above folder
Then configure Blobfuse else we are getting permission denied while creating forest
Use below command to give permission to all
chmod 777 -R
Now when we started importing using MarkLogic Content Pump (MLCP)
19/03/15 17:01:19 ERROR mapreduce.ContentWriter: SVC-FILSTAT: File status error: stat64 '/mnt/mycontainer/Forests/forest-01/000043e5': Permission denied
So if you look at below image
1st we tried with mycontainer but as soon as we map it to Azure Blob, it does not looks green as azureblob which is. We still need to map azureblob to "azureblob" folder.
It seems i am missing something here, anything to do with Azure Blob security settings?
With the test, when you mount the Azure Blob to Linux, for example, Ubuntu 18.04 (which I'm using), if you want to allow other users to use the mount directory, you can add the parameter -o allow_other when you execute the command blobfuse.
To allow access to all users, you can mount via the option -o
allow_other.
Also, I think you should give others permission through the command chown. For more details, see How to mount Blob storage as a file system with blobfuse.
First i would like to thanks Charles for his efforts and extended help on this issue, Thanks Charls :). I am sure this will help me sometime, somewhere.
I got link on how to setup MarkLogic on Aure
On Page No. 27, steps to Configuring MarkLogic for Azure Blob Storage
In summary it is
Create Storage account in Azure
Create Blob container
Go to MarkLogic server (http://localhost:8001)
Go to Security -> Credentials
Provide Storage account and Azure storage key
While creating MarkLogic Forest, mentioned container path in data directory
azure://mycontainer/mydirectory/myfile
And you are done. No Blobfuse, no drive mount, just a configuration in MarkLogic
Awesome!!
Its working like dream :)

AzureRM - Ubuntu VM created using uploaded VHD stuck waiting on boot prompt

I have an Ubuntu Server 17.10 VM in vCenter that I exported using Export-VApp, then used Microsoft's Virtual Machine Converter to create a VHD. Created an Azure RM Disk Image from that and spun up a VM, all of which seemed to go fine. My problem is that the New-AzureRMVM gets stuck in creating, and when I go to the boot diagnostics from the screenshot it is stuck on a "Please unlock disk sda5_crypt:". First, from what I gather is there really no way to get console access to my VM so that I can enter this? It won't get past creating so connect is greyed out and I can't SSH into it. Is my only option here to go back to the VM on vCenter and migrate the entire partition to a new partition without disk encryption, then redeploy? Is there any sort of startup file Azure accepts that could input this for me?

share storage account on different subscription and location

I successfully mounted a Azure File Storage to a VM which is inside the same subscription and location. Now I cloned this VM to a new subscription and another location - so my new machine is exactly the same except of subscription and location. When I run the same command for mounting the same file storage:
sudo mount -t cifs //MYACCOUNT.file.core.windows.net/MY/FOLDER /MY/LOCAL/FOLDER/ -o vers=3.0,username=USER,password=ACCESSKEY,file_mode=0777,dir_mode=0777
then I get
mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
I think it has something to do with the different subscription and location, because in the portal when I click on connect in my file storage it is said:
To connect to this file share, run this command from any Windows virtual machine on the same subscription and location:
So is there any possibility to connect to my file storage from within another subscription and location?
You need to use the SMB 3.0 protocol to connect outside of that Azure region. This page says it's not supported on Linux:
https://azure.microsoft.com/en-us/documentation/articles/storage-how-to-use-files-linux/
Note that since the Linux SMB client doesn’t yet support encryption, mounting a file share from Linux still requires the client to be in the same Azure region as the file share. However, encryption support for Linux is on the roadmap of Linux developers responsible for SMB functionality.
Edit: There is an update on Ubuntu here.

Azure - Redeploy existing windows VMs in Azure to connect to Virtual Network

I need to connect my existing VMs to new Virtual Network. Documentations says you have to redeploy them, but I could not find any source which says how to redeploy an existing VM.
Thanks,
Prasad
Create an image of your VM:
Select your VM
Hit Capture on the bottom bar. Give it a name and make sure it completes successfully
Navigate to Cloud Service >> Select the CS >> Delete >> Chose CS and it's deployments
Review the list of VMs and disks that are going to be deleted
Delete
Redeploy the VM from Image:
Click New >> Compute >> Virtual Machine >> From Gallery
On the right side >> Click My Images >> Select your captured image
Complete the wizard. Make sure to select the correct Virtual Network.
Pre-requisites:
Virtual Network is in the same location as the captured Image. Otherwise you will have to move the VHD to a storage located in the same data center as the new Virtual Network. Virtual Network will not show up on the list if this pre-requisite is not met.
If you intend to use the captured image to deploy several other VMs with the same content you will have to run sysprep (windows) or deprovision waagent (linux) before capturing. Otherwise you will have connectivity problems since all the vms will share the same unique Ids.
More Info:
How to Capture a Windows Virtual Machine to Use as a Template:
http://azure.microsoft.com/en-us/documentation/articles/virtual-machines-capture-image-windows-server/
How to Capture a Linux Virtual Machine to Use as a Template: http://azure.microsoft.com/en-us/documentation/articles/virtual-machines-linux-capture-image/

Resources