Need vm timezone to be different than platform running on - virtualbox

My company just moved the servers across the US. Opposite side from users.
What comes across the wire is the adjusted time.
Example:
database returns 01-Sep-2013 00:00:00.000 the we web app.
Accross the wire 31-Aug-2013 22:00:00.000
to code and test my fix I either need development deployment system in the mid west (very doubtful) or a way to change the timezone for my executing VM.
I see there are ways to break link by using UTC. However I don't want to use UTC. I want my vm to appear to be in one of the various US timezones. Not sure what switching timezones does to oracle installs but will have to cross that problem.
Thoughts anyone solve this problem???

The VM's date is based off of the physical computers HW clock.
If you need the VM to be some date in the past. Adjust the the clock backwards, start the VM.
If you need to change the VM's time zone.
changing timezone is dependent on specific vm. I am using centos. Find desired timezone in /usr/share/zoneinfo.
mv /etc/localtime /etc/localtime.orig
ln -s /usr/share/zoneinfo/XXXXXX/YYY /etc/localtime
Not sure if you have to reboot. Unfortunately there is not easy way to say I want the vm to suddenly be in another time zone.

Related

Google Cloud VM Files Deleted after session disconnect

I am having some of my GCP instances behave in a way similar to what is described in the below link:
Google Cloud VM Files Deleted after Restart
The session gets disconnected after a small duration of inactivity at times. On reconnecting, the machine is as if it is freshly installed. (Not on restarts as in the above link). All the files are gone.
As you can see in the attachment, it is creating the profile directory fresh when the session is reconnected. Also, none of the installations I have made are there. Everything is lost including the root installations. Fortunately, I have been logging all my commands and file set ups manually on my client. So, nothing is lost, but I would like to know what is happening and resolve this for good.
This has now happened a few times.
A point to note is that if I get a clean exit, like if I properly logout or exit from the ssh, I get the machine back as I have left, when I reconnect. The issue is there only when the session disconnects itself. There have been instances where the session disconnected and I was able to connect back as well.
The issue is not there on all my VMs.
From the suggestions from the link I have posted above:
I am not connected to the cloud shell. i am taking ssh of the machine using the chrome extension
Have not manually mounted any disks (afaik)
I have checked the logs from gcloud compute instances get-serial-port-output --zone us-east4-c INSTANCE_NAME. I could not really make much of it. Is there anything I should look for specifically?
Any help is appreciated.
Please find the links to the logs as suggested by #W_B
Below is from 8th when the machine was restarted and files deleted
https://pastebin.com/NN5dvQMK
It happened again today. I didn't run the command immediately then. The below file is from afterwards though
https://pastebin.com/m5cgdLF6
The below one is after logout today.
[4]: https://pastebin.com/143NPatF
Please note that I have replaced the user id, system name and a lot of numeric values in general using regexp. So, there is a slight chance that the time and other values have changed. Not sure if that would be a problem.
I have added the screenshot of the current config from the UI
Using locally attached SDD seems to be the cause ... here it is explained:
https://cloud.google.com/compute/docs/disks/local-ssd#data_persistence
You need to use a "persistent disk" - else it will behave just as you describe it.

Browser drops connection during model training

I am currently trying to go through a fairly long hyperparameter grid search (4-5 hours) and I keep having issues with Jupyter Lab (or haven't figured out something yet) on a gcp notebook instance. The browser connection to the notebook keeps dropping, whereas the training process continues just fine. When it finishes training process, there's nowhere to write the output as the browser connection to the notebook has already dropped.
How can I keep that connection alive or make sure the output gets written into the notebook even if my laptop gets turned off/gets turned off?
There are multiple problems that may be affecting your notebook. It can be a GCP issue, a network issue... Therefore, you need to provide more information in order to diagnose what is happening. I would recommend you to open a ticket with GCP or Jupyter support to conduct a more thorough investigation as it can be something difficult to diagnose and they will have more tools to do it. Also, what #Joaquim suggested seems like a good workaround for the moment. Anyhow, I have gathered several troubleshooting steps that you can follow to find if it is one of this recurrent issues the one that is affecting you:
According to this Jupyter Notebook document, there is a ‘shutdown_no_activity_timeout’ option. The default value is ‘0’ that disables this automatic shutdown. The option might be overridden on ‘jupyter_notebook_config.py’ file. You may follow these steps to confirm it:
Click on the instance name of in which your Notebook is running on the AI Platform Notebooks page.
Remote access it by clicking “SSH”
Run this on the shell to confirm the existence of the overriding:
ls /home/*/.jupyter/jupyter_notebook_config.py
Run this command to confirm if the shutdown_no_activity_timeout option is doing the overriding:
cat /home/*/.jupyter/jupyter_notebook_config.py | grep shutdown_no_activity_timeout
Switch the option to ‘0’ if it is set to a different value, and reset the Notebook instances on this page to apply the change.
According to this other document, it might fail to connect when behind a proxy. You can try to disable your browser’s proxy settings.
You can also try to change the Jupyter port. On this Jupyter issue, the customer insists that his disconnection problem was gone after changing it. If you are using Chrome browser, could you please open the Inspect panel (Ctrl+Shift+I) and compare your connection symptoms with this image? If you get similar errors, you may try to change the port (c.NotebookApp.port).

How to adjust the time settings on an AWS instance?

When I type date on my AWS Linux instance, I get the time as 4 hours earlier than it is in my personal timezone.
I'd like to change this, since some logs I'm writing are showing times in the future, but I don't know how.
I can only find this page on the topic (other Google results appear very old), and the advice it gives is to modify the clock file...which I don't see existing at /etc/sysconfig/clock.
I am running Ubuntu.
Does anyone know how to adjust the time settings on an AWS instance?
on ubuntu, you can run dpkg-reconfigure tzdata and select your region/country to change your time zone settings

A non-changeable VMWare image

I know the title is a bit weird, but I was unable to think a better one.
I wasunsuccessful in looking (googling) for creating a non-changeable VMWare image. I am not sure if this is even possible or not? Well the idea is that after VMWare restart I always have the same state.
Does anyone have any idea? Thanx in advance and hope it was not a completely stupid question.
Assuming you mean that when you power off your VM you want it to revert back to a known state and lose the latest changes, then this is possible with VMWare Workstation and I suspect other versions too.
You need to get the VM to the state you want to roll back too, shut it down and take a snapshot of this state.
You can now change the snapshot settings of the VM (VM->Settings->Options->Snapshots I think, but I'm not in front of VMWare at the moment, so may be wrong). Now you can set the VM to "When Powering Off: Revert To Snapshot". Now, every time the VM is powered down, it should revert to your known "baseline".
The only way I can think of you being able to do this Gico is that if you have a snapshot of the VM in whatever state you want, then revert to that snapshot whenever you need to, after a power down. This is definetly possible if you are using vSphere, not sure about the rest of VMware's products.
To do this in vSphere, get the machine in to the state you want, right click the VM in the vSphere Management console/ vCenter, select 'Snapshot -> Take Snapshot'. Then in the same snapshot menu use 'Snapshot Manager' to revert to that snapshot whenever you need to.
Maybe a way of reverting the snapshot automatically is described at this link:
http://www.vmware.com/support/ws5/doc/ws_preserve_sshot_revert_or_goto.html
Look in the Reverting at Power Off section.
It is possible to use 'Revert at power off' in VMware player too.

Whats the best way to get started with server virtualization?

We recently bought a new rack and set of servers for it, we want to be able to redeploy these boxes as build servers, QA regression test servers, lab re-correlation servers, simulation servers, etc.
We have played a bit with VMWare, VirtualPC, VirtualBox etc, creating a virtual build server, but we came across a lot of issues when we tried to copy it for others to use, having to reconfigure every new copy of the VM.
We are using Windows XP x86/x64 and Windows Vista x86/x64, so I had to rename the machine, join the domain etc for every new copy.
Ideally we just want to be able to add a new box, deploy a thin boot strap OS (Linux is fine here) to get the VM up an running, then use it.
One other thing we have limited to no budget, so free is best.
I would like to understand others experiences in doing the same thing.
FYI, I am not in systems IT, this we are group of software engineers trying to set this up.
Any links to good tutorials would be great.
The problem you're running into is the machine SID must be unique for each machine in a domain. Of course by copying an image you now break that unique constraint.
I'd suggest that you read the documentation for Sysprep in the reskit and Vista System Image Manager - your friends for XP/Win2k3 and Vista/Win2k8 respectively.
These tools enable to "reseal" your configured instance of the OS such that the next time it boots - it can prompt for information such as network configuration, machine names, admin user ID's, run scripts etc.
Also be aware that the licencing restrictions for Windows desktop clients are generally per image - not per server.
Using these tools with HyperV we created complete preconfigured instances of Win2k3 & Win2k8 that boot to finish installing Sharepoint - going further we used the diffing disks to overlay Visual Studio so our devs could use the production images for their work. It has radically changed our development process.
At this point our entire public website is run on HyperV with of 5 boxes running 15 images for a mix of soft and hard redundancy - they take several hundred million page views per week.
Another option for dealing with the SID probelm is NewSID. This is a simpler tool than sysprep, in that all it does is rename the machine and reassign the SID; if you don't need all the other features of sysprep this is a much easier tool to use.